Skip to content

Commit 63cd471

Browse files
authored
Merge pull request #63 from PolicyEngine/fix/fully-fix-changelogging
Determine why sequenced update not working
2 parents 0e81f4b + e82954a commit 63cd471

3 files changed

Lines changed: 95 additions & 34 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Pull request
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
name: Lint
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: 3.12
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install black
21+
- name: Check formatting
22+
run: black . -l 79 --check
23+
check-version:
24+
name: Check version
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0 # Fetch all history for all tags and branches
31+
repository: ${{ github.event.pull_request.head.repo.full_name }}
32+
ref: ${{ github.event.pull_request.head.ref }}
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: 3.12
37+
- name: Build changelog
38+
run: pip install "yaml-changelog>=0.1.7" && make changelog
39+
- name: Preview changelog update
40+
run: ".github/get-changelog-diff.sh"
41+
- name: Check version number has been properly updated
42+
run: ".github/is-version-number-acceptable.sh"
43+
test:
44+
name: Build and test
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0 # Fetch all history for all tags and branches
51+
- name: Set up Python
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version: 3.12
55+
- name: Install package
56+
run: pip install -e ".[dev]"
57+
- name: Download data inputs
58+
run: make download
59+
env:
60+
POLICYENGINE_US_DATA_GITHUB_TOKEN: ${{ secrets.POLICYENGINE_US_DATA_GITHUB_TOKEN }}
61+
- name: Build datasets
62+
run: make data
63+
env:
64+
TEST_LITE: true
65+
- name: Run tests
66+
run: pytest
67+
- name: Test documentation builds
68+
run: make documentation
Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
name: CI/CD
1+
name: Push
22

33
on:
4-
pull_request:
5-
branches: [main]
64
push:
75
branches: [main]
6+
workflow_dispatch:
87

98
jobs:
109
lint:
1110
runs-on: ubuntu-latest
12-
if: >
13-
github.event_name == 'pull_request' ||
14-
(
15-
github.repository == 'PolicyEngine/policyengine-us-data'
16-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
17-
)
11+
if: |
12+
(github.repository == 'PolicyEngine/policyengine-us-data')
13+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
1814
name: Lint
1915
steps:
2016
- uses: actions/checkout@v4
@@ -31,12 +27,9 @@ jobs:
3127
check-version:
3228
name: Check version
3329
runs-on: ubuntu-latest
34-
if: >
35-
github.event_name == 'pull_request' ||
36-
(
37-
github.repository == 'PolicyEngine/policyengine-us-data'
38-
&& github.event.head_commit.message != 'Update PolicyEngine US data'
39-
)
30+
if: |
31+
(github.repository == 'PolicyEngine/policyengine-us-data')
32+
&& !(github.event.head_commit.message == 'Update PolicyEngine US data')
4033
steps:
4134
- name: Checkout code
4235
uses: actions/checkout@v4
@@ -55,7 +48,6 @@ jobs:
5548
- name: Check version number has been properly updated
5649
run: ".github/is-version-number-acceptable.sh"
5750
- name: Update changelog
58-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5951
uses: EndBug/add-and-commit@v9
6052
with:
6153
add: "."
@@ -66,12 +58,9 @@ jobs:
6658
test:
6759
name: Build and test
6860
runs-on: ubuntu-latest
69-
if: >
70-
github.event_name == 'pull_request' ||
71-
(
72-
github.repository == 'PolicyEngine/policyengine-us-data'
73-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
74-
)
61+
if: |
62+
(github.repository == 'PolicyEngine/policyengine-us-data')
63+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
7564
steps:
7665
- name: Checkout code
7766
uses: actions/checkout@v4
@@ -98,9 +87,9 @@ jobs:
9887
publish-to-pypi:
9988
name: Publish to PyPI
10089
runs-on: ubuntu-latest
101-
if: >
102-
github.repository == 'PolicyEngine/policyengine-us-data'
103-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
90+
if: |
91+
(github.repository == 'PolicyEngine/policyengine-us-data')
92+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
10493
steps:
10594
- name: Checkout code
10695
uses: actions/checkout@v4
@@ -125,9 +114,9 @@ jobs:
125114
docker:
126115
name: Docker
127116
runs-on: ubuntu-latest
128-
if: >
129-
github.repository == 'PolicyEngine/policyengine-us-data'
130-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
117+
if: |
118+
(github.repository == 'PolicyEngine/policyengine-us-data')
119+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
131120
steps:
132121
- name: Checkout repo
133122
uses: actions/checkout@v4
@@ -144,9 +133,9 @@ jobs:
144133
publish-docs:
145134
name: Publish documentation
146135
runs-on: ubuntu-latest
147-
if: >
148-
github.repository == 'PolicyEngine/policyengine-us-data'
149-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
136+
if: |
137+
(github.repository == 'PolicyEngine/policyengine-us-data')
138+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
150139
steps:
151140
- name: Checkout code
152141
uses: actions/checkout@v4
@@ -170,9 +159,9 @@ jobs:
170159
name: Upload data
171160
runs-on: ubuntu-latest
172161
needs: [lint, test]
173-
if: >
174-
github.repository == 'PolicyEngine/policyengine-us-data'
175-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
162+
if: |
163+
(github.repository == 'PolicyEngine/policyengine-us-data')
164+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
176165
steps:
177166
- name: Checkout code
178167
uses: actions/checkout@v4

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
changed:
4+
- Fixed CI/CD push script

0 commit comments

Comments
 (0)