Skip to content

Commit 167dac9

Browse files
committed
split into two artifacts
1 parent dbd2827 commit 167dac9

1 file changed

Lines changed: 26 additions & 45 deletions

File tree

.github/workflows/build.yml

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ jobs:
124124
compose-config: ${{ steps.artifacts.outputs.compose-config }}
125125
docker-events: ${{ steps.artifacts.outputs.docker-events }}
126126
steps:
127+
- name: Set ARTIFACTS_DIR
128+
run: echo "ARTIFACTS_DIR=${RUNNER_TEMP}/artifacts" >> $GITHUB_ENV
129+
130+
- name: Create the artifacts directory
131+
run: mkdir -p "$ARTIFACTS_DIR/unittests"
132+
127133
- name: Checkout code
128134
uses: actions/checkout@v4
129135

@@ -159,22 +165,27 @@ jobs:
159165
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: ::add-mask::postgresql+psycopg2://airflow:airflow@postgres/airflow
160166
AIRFLOW__CELERY__RESULT_BACKEND: ::add-mask::db+postgresql://airflow:airflow@postgres/airflow
161167
run: |
162-
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
163-
echo "compose-logs<<$EOF" | tee -a "$GITHUB_OUTPUT"
164-
docker compose logs | tee -a "$GITHUB_OUTPUT"
165-
echo "$EOF" | tee -a "$GITHUB_OUTPUT"
166-
echo "compose-config<<$EOF" | tee -a "$GITHUB_OUTPUT"
167-
docker compose config | tee -a "$GITHUB_OUTPUT"
168-
echo "$EOF" | tee -a "$GITHUB_OUTPUT"
169-
echo "docker-events<<$EOF" | tee -a "$GITHUB_OUTPUT"
170-
docker events --format '{{ json . }}' --since $TEST_START --until `date +%s` | tee -a "$GITHUB_OUTPUT"
171-
echo "$EOF" | tee -a "$GITHUB_OUTPUT"
168+
docker compose logs | tee "${ARTIFACTS_DIR}/docker-services.log"
169+
docker compose config | tee "${ARTIFACTS_DIR}/docker-compose.merged.yml"
170+
docker events --json --since $TEST_START --until `date +%s` | tee "${ARTIFACTS_DIR}/docker-events.json"
171+
172+
- name: Upload test report
173+
if: ${{ always() }}
174+
uses: actions/upload-artifact@v4
175+
with:
176+
name: mokelumne Docker Test Report (${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }})
177+
path: ${{ env.ARTIFACTS_DIR }}
178+
if-no-files-found: error
172179

173180
test-dag-imports:
174181
runs-on: ubuntu-24.04
175-
outputs:
176-
xmlrunner: ${{ steps.artifacts.outputs.xmlrunner }}
177182
steps:
183+
- name: Set ARTIFACTS_DIR
184+
run: echo "ARTIFACTS_DIR=${RUNNER_TEMP}/artifacts" >> $GITHUB_ENV
185+
186+
- name: Create the artifacts directory
187+
run: mkdir -p "$ARTIFACTS_DIR/unittests"
188+
178189
- name: Checkout code
179190
uses: actions/checkout@v4
180191

@@ -188,50 +199,20 @@ jobs:
188199
run: |
189200
python test/run_tests.py
190201
191-
- name: Copy out artifacts
192-
id: artifacts
193-
if: ${{ always() }}
194-
run: |
195-
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
196-
echo "xmlrunner<<$EOF" | tee -a "$GITHUB_OUTPUT"
197-
cat artifacts/unittest/airflow_test.xml | tee -a "$GITHUB_OUTPUT"
198-
echo "$EOF" | tee -a "$GITHUB_OUTPUT"
199-
200-
upload-artifacts:
201-
runs-on: ubuntu-24.04
202-
needs:
203-
- test-startup
204-
- test-dag-imports
205-
steps:
206-
- name: Set ARTIFACTS_DIR
207-
run: echo "ARTIFACTS_DIR=${RUNNER_TEMP}/artifacts" >> $GITHUB_ENV
208-
209-
- name: Create the artifacts directory
210-
run: mkdir -p "$ARTIFACTS_DIR/unittests"
211-
- name: Create artifact outputs
212-
env:
213-
COMPOSE_CONFIG: ${{ needs.test-startup.outputs.compose-config }}
214-
COMPOSE_LOGS: ${{ needs.test-startup.outputs.compose-logs }}
215-
DOCKER_EVENTS: ${{ needs.test-startup.outputs.docker-events }}
216-
XMLRUNNER: ${{ needs.test-dag-imports.outputs.xmlrunner }}
217-
run: |
218-
echo "$COMPOSE_CONFIG" | tee "$ARTIFACTS_DIR/docker-compose.merged.yml"
219-
echo "$COMPOSE_LOGS" | tee "$ARTIFACTS_DIR/docker-services.log"
220-
echo "$DOCKER_EVENTS" | tee "$ARTIFACTS_DIR/docker-events.json"
221-
echo "$XMLRUNNER" | tee "$ARTIFACTS_DIR/unittests/airflow_test.xml"
222202
- name: Upload test report
223203
if: ${{ always() }}
224204
uses: actions/upload-artifact@v4
225205
with:
226-
name: mokelumne Test Report (${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }})
206+
name: mokelumne Python Test Report (${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }})
227207
path: ${{ env.ARTIFACTS_DIR }}
228208
if-no-files-found: error
229209

230210
push:
231211
runs-on: ubuntu-24.04
232212
needs:
233213
- merge
234-
- upload-artifacts
214+
- test-dag-imports
215+
- test-startup
235216
env:
236217
DOCKER_APP_IMAGE: ${{ needs.merge.outputs.image }}
237218
steps:

0 commit comments

Comments
 (0)