-
Notifications
You must be signed in to change notification settings - Fork 34
65 lines (54 loc) · 1.7 KB
/
data_tests_changed_files.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Data Tests (Changed Files)
on:
pull_request:
jobs:
data_tests:
name: Data tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: [duplicate_entries, file_format, missing_values, vote_breakdown_totals]
env:
LOG_FILE: ${{ github.workspace }}/${{ matrix.test }}.txt
steps:
- name: Save the pull request number in an artifact
shell: bash
run: echo ${{ github.event.number }} > pull_request_number.txt
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Check out data
uses: actions/checkout@v4
with:
path: data
fetch-depth: 0
- name: Check out data tests
uses: actions/checkout@v4
with:
repository: openelections/openelections-data-tests
ref: v2.2.0
path: data_tests
- name: Get changed *.csv files
id: changed-files
uses: tj-actions/changed-files@v45
with:
path: data
files: |
**/*.csv
- name: Run data tests
if: "${{ steps.changed-files.outputs.added_files != '' }}"
run: python3 ${{ github.workspace }}/data_tests/run_tests.py --files ${{ steps.changed-files.outputs.added_files }} --group-failures --log-file=${{ env.LOG_FILE }} --truncate-log-file ${{ matrix.test }} ${{ github.workspace }}/data
- name: Upload the pull request number
uses: actions/upload-artifact@v4
if: failure()
with:
name: pull_request_number
path: ./pull_request_number.txt
- name: Upload error logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.test }}
path: ${{ env.LOG_FILE }}