1+ name : CI/CD
2+
3+ on :
4+ pull_request :
5+ branches : [main]
6+
7+ jobs :
8+ lint :
9+ runs-on : ubuntu-latest
10+ if : |
11+ (github.repository == 'PolicyEngine/policyengine-us-data')
12+ && (github.event.head_commit.message == 'Update PolicyEngine US data')
13+ name : Lint
14+ steps :
15+ - uses : actions/checkout@v4
16+ - name : Set up Python
17+ uses : actions/setup-python@v5
18+ with :
19+ python-version : 3.12
20+ - name : Install dependencies
21+ run : |
22+ python -m pip install --upgrade pip
23+ pip install black
24+ - name : Check formatting
25+ run : black . -l 79 --check
26+ check-version :
27+ name : Check version
28+ runs-on : ubuntu-latest
29+ if : |
30+ (github.repository == 'PolicyEngine/policyengine-us-data')
31+ && (github.event.head_commit.message == 'Update PolicyEngine US data')
32+ steps :
33+ - name : Checkout code
34+ uses : actions/checkout@v4
35+ with :
36+ fetch-depth : 0 # Fetch all history for all tags and branches
37+ repository : ${{ github.event.pull_request.head.repo.full_name }}
38+ ref : ${{ github.event.pull_request.head.ref }}
39+ - name : Set up Python
40+ uses : actions/setup-python@v5
41+ with :
42+ python-version : 3.12
43+ - name : Build changelog
44+ run : pip install "yaml-changelog>=0.1.7" && make changelog
45+ - name : Preview changelog update
46+ run : " .github/get-changelog-diff.sh"
47+ - name : Check version number has been properly updated
48+ run : " .github/is-version-number-acceptable.sh"
49+ - name : Update changelog
50+ # if: github.event_name == 'push' && github.ref == 'refs/heads/main'
51+ uses : EndBug/add-and-commit@v9
52+ with :
53+ add : " ."
54+ committer_name : Github Actions[bot]
55+ author_name : Github Actions[bot]
56+ message : Update PolicyEngine US data
57+ github_token : ${{ secrets.POLICYENGINE_GITHUB }}
58+ test :
59+ name : Build and test
60+ runs-on : ubuntu-latest
61+ if : |
62+ (github.repository == 'PolicyEngine/policyengine-us-data')
63+ && (github.event.head_commit.message == 'Update PolicyEngine US data')
64+ steps :
65+ - name : Checkout code
66+ uses : actions/checkout@v4
67+ with :
68+ fetch-depth : 0 # Fetch all history for all tags and branches
69+ - name : Set up Python
70+ uses : actions/setup-python@v5
71+ with :
72+ python-version : 3.12
73+ - name : Install package
74+ run : pip install -e ".[dev]"
75+ - name : Download data inputs
76+ run : make download
77+ env :
78+ POLICYENGINE_US_DATA_GITHUB_TOKEN : ${{ secrets.POLICYENGINE_US_DATA_GITHUB_TOKEN }}
79+ - name : Build datasets
80+ run : make data
81+ env :
82+ TEST_LITE : true
83+ - name : Run tests
84+ run : pytest
85+ - name : Test documentation builds
86+ run : make documentation
0 commit comments