-
-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (43 loc) · 1.39 KB
/
verify_data_Integrity.yml
File metadata and controls
50 lines (43 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
on:
workflow_dispatch:
pull_request:
paths:
- "data/*.csv"
push:
paths:
- "data/*.csv"
name: Verify station data integrity
permissions:
contents: read
jobs:
verify_migration_data:
name: Verify pushed migration data
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run data validator
id: validate
run: |
if cargo run --bin data_validator; then
echo "result=success" >> "$GITHUB_OUTPUT"
else
echo "result=failure" >> "$GITHUB_OUTPUT"
fi
- name: Save metadata for comment workflow
if: always() && github.event_name == 'pull_request'
run: |
mkdir -p /tmp/validation-artifacts
echo "${{ github.event.pull_request.number }}" > /tmp/validation-artifacts/pr_number
echo "${{ steps.validate.outputs.result }}" > /tmp/validation-artifacts/result
if [ -f /tmp/validation_report.md ]; then
cp /tmp/validation_report.md /tmp/validation-artifacts/
fi
- name: Upload validation artifacts
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: validation-result
path: /tmp/validation-artifacts/
- name: Fail job if validation failed
if: steps.validate.outputs.result == 'failure'
run: exit 1