Skip to content

Commit a008e45

Browse files
committed
add synth
1 parent 2e29335 commit a008e45

File tree

3 files changed

+68
-20
lines changed

3 files changed

+68
-20
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
inputs:
2+
python-version:
3+
description: "Python version to use"
4+
required: true
5+
venv-cache-key:
6+
description: "Cache key for the virtual environment"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- uses: actions/setup-python@v5
13+
with:
14+
python-version: ${{ inputs.python-version }}
15+
- uses: actions/cache@v4
16+
with:
17+
path: .venv
18+
key: ${{ inputs.venv-cache-key }}
19+
fail-on-cache-miss: true
20+
- uses: snok/install-poetry@v1
21+
with:
22+
virtualenvs-create: true
23+
virtualenvs-in-project: true

.github/workflows/check.yml

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,55 @@ jobs:
2727
path: .venv
2828
key: ${{ steps.cache-key.outputs.value }}
2929

30-
check:
30+
lint:
3131
needs: setup
3232
runs-on: ubuntu-latest
33-
strategy:
34-
matrix:
35-
task: [ lint, types, test ]
36-
fail-fast: false
3733
steps:
3834
- uses: actions/checkout@v4
39-
- uses: actions/setup-python@v5
35+
- uses: ./.github/actions/setup-check
4036
with:
4137
python-version: ${{ env.python-version }}
42-
- uses: actions/cache@v4
43-
with:
44-
path: .venv
45-
key: ${{ needs.setup.outputs.cache-key }}
46-
fail-on-cache-miss: true
47-
- uses: snok/install-poetry@v1
48-
with:
49-
virtualenvs-create: true
50-
virtualenvs-in-project: true
38+
venv-cache-key: ${{ needs.setup.outputs.cache-key }}
39+
- run: make lint
5140

52-
- if: matrix.task == 'types'
53-
uses: actions/cache@v4
41+
types:
42+
needs: setup
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: ./.github/actions/setup-check
47+
with:
48+
python-version: ${{ env.python-version }}
49+
venv-cache-key: ${{ needs.setup.outputs.cache-key }}
50+
- uses: actions/cache@v4
5451
with:
5552
path: .mypy_cache
5653
key: mypy-${{ runner.os }}-${{ env.python-version }}-${{ hashFiles('**/*.py') }}
5754
restore-keys: mypy-${{ runner.os }}-${{ env.python-version }}-
55+
- run: make types
5856

59-
- run: make ${{ matrix.task }}
57+
test:
58+
needs: setup
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: ./.github/actions/setup-check
63+
with:
64+
python-version: ${{ env.python-version }}
65+
venv-cache-key: ${{ needs.setup.outputs.cache-key }}
66+
- run: make test
67+
68+
synth:
69+
needs: setup
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: ./.github/actions/setup-check
74+
with:
75+
python-version: ${{ env.python-version }}
76+
venv-cache-key: ${{ needs.setup.outputs.cache-key }}
77+
- uses: actions/setup-node@v3
78+
with:
79+
node-version: '22'
80+
- run: npm install -g aws-cdk
81+
- run: make synth

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ types:
1313
test:
1414
poetry run python -m unittest discover -s 'tests' -p '*.py'
1515

16-
check: lint types test
16+
synth:
17+
cdk synth
18+
19+
check: lint types test synth
1720

1821
diff:
19-
cdk diff --fail
22+
cdk diff
2023

2124
deploy:
2225
cdk deploy --require-approval never

0 commit comments

Comments
 (0)