88 run_env :
99 description : ' a string containing env vars for the command e.g. "MY_VAR1=foo MY_VAR2=bar"'
1010 default : ' '
11+ runtime :
12+ description : ' the tmpnet runtime being used'
13+ default : ' process'
1114 filter_by_owner :
1215 default : ' '
1316 artifact_prefix :
6770 # --impure ensures the env vars are accessible to the command
6871 run : ${{ inputs.run_env }} ${{ github.action_path }}/nix-develop.sh --impure --command bash -x ${{ inputs.run }}
6972 env :
73+ # Always collect metrics locally even when nodes are running in kube to enable collection from the test workload
7074 TMPNET_START_METRICS_COLLECTOR : ${{ inputs.prometheus_username != '' }}
71- TMPNET_START_LOGS_COLLECTOR : ${{ inputs.loki_username != '' }}
75+ # Skip local log collection when nodes are running in kube since collection will occur in-cluster.
76+ TMPNET_START_LOGS_COLLECTOR : ${{ inputs.loki_username != '' && inputs.runtime == 'process' }}
7277 TMPNET_CHECK_METRICS_COLLECTED : ${{ inputs.prometheus_username != '' }}
7378 TMPNET_CHECK_LOGS_COLLECTED : ${{ inputs.loki_username != '' }}
7479 LOKI_USERNAME : ${{ inputs.loki_username }}
8691 # easy way to compose custom actions for use by other repos
8792 # without running into versioning issues.
8893 - name : Upload tmpnet data
89- if : always()
94+ if : always() && (inputs.runtime == 'process')
9095 uses : actions/upload-artifact@v4
9196 with :
9297 name : ${{ inputs.artifact_prefix }}-tmpnet-data
@@ -95,3 +100,14 @@ runs:
95100 ~/.tmpnet/prometheus/prometheus.log
96101 ~/.tmpnet/promtail/promtail.log
97102 if-no-files-found : error
103+ - name : Export kind logs
104+ if : always() && (inputs.runtime == 'kube')
105+ shell : bash
106+ run : kind export logs /tmp/kind-logs
107+ - name : Upload kind logs
108+ if : always() && (inputs.runtime == 'kube')
109+ uses : actions/upload-artifact@v4
110+ with :
111+ name : ${{ inputs.artifact_prefix }}-kind-logs
112+ path : /tmp/kind-logs
113+ if-no-files-found : error
0 commit comments