Skip to content

Commit de729d9

Browse files
authored
chore(CI): Update github actions to latest versions (#933)
* Update github actions to latest * update actions in contract-integration workflow * Update actions for pypi-release * Update actions for schema-updater * Update setup-java action to distribution from v1 in contract-integration * enable pip and pre-commit caching, enable manual workflow trigger * Add python version cache key for precommit cache * continue on error but fail pipeline if error happened during integration run * remove set +e and set -o pipefail, GHA doesn't appear to reference pipefail for status * Make cfn test more verbose in contract integration test * Remove contract integration from pull requests but keep for push/merge to main branch
1 parent 3491f7a commit de729d9

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

.github/workflows/contract-integration.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
on:
22
push:
33
branches: [ master ]
4-
pull_request:
5-
branches: [ master ]
4+
5+
workflow_dispatch: # Enables on-demand/manual triggering: https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
66
jobs:
77
contract-integration-java:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v3
1212
with:
1313
repository: aws-cloudformation/aws-cloudformation-resource-providers-lookoutvision
1414
path: lookoutvision
15-
- uses: actions/setup-java@v1
15+
- uses: actions/setup-java@v3
1616
with:
17+
distribution: 'zulu' # match distribution for v1
1718
java-version: 8
18-
- uses: actions/setup-python@v2
19+
- uses: actions/setup-python@v4
1920
with:
2021
python-version: 3
22+
cache: 'pip'
2123
- run: |
2224
pip install -e .
2325
cd lookoutvision/*project
@@ -27,7 +29,7 @@ jobs:
2729
sam local start-lambda &
2830
pip install --quiet cloudformation-cli-java-plugin cloudformation-cli-python-plugin
2931
mvn package --no-transfer-progress -Dmaven.test.skip=true
30-
cfn test --enforce-timeout 240
32+
cfn test --enforce-timeout 240 -vvv
3133
! grep -q -E -i '(accessKeyId|secretAccessKey|sessionToken)' rpdk.log*
3234
env:
3335
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -36,14 +38,15 @@ jobs:
3638
contract-integration-python:
3739
runs-on: ubuntu-latest
3840
steps:
39-
- uses: actions/checkout@v2
40-
- uses: actions/checkout@v2
41+
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v3
4143
with:
4244
repository: aws-cloudformation/aws-cloudformation-resource-providers-frauddetector
4345
path: frauddetector
44-
- uses: actions/setup-python@v2
46+
- uses: actions/setup-python@v4
4547
with:
4648
python-version: 3
49+
cache: 'pip'
4750
- run: |
4851
pip install -e .
4952
cd frauddetector/*outcome
@@ -53,7 +56,7 @@ jobs:
5356
sam local start-lambda &
5457
pip install --quiet cloudformation-cli-java-plugin cloudformation-cli-python-plugin
5558
cfn submit --dry-run
56-
cfn test --enforce-timeout 240
59+
cfn test --enforce-timeout 240 -vvv
5760
! grep -q -E -i '(accessKeyId|secretAccessKey|sessionToken)' rpdk.log*
5861
env:
5962
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

.github/workflows/pr-ci.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
# This workflow will install Python dependencies, run tests and lint with a multiple versions of Python
33
name: CloudFormation CLI Pull Request CI
44

5-
on:
6-
push:
7-
branches: [ master ]
8-
pull_request:
9-
branches: [ master ]
5+
on: [push, pull_request]
106

117
jobs:
128
build:
@@ -18,17 +14,22 @@ jobs:
1814
os: [ubuntu-latest, macos-latest, windows-latest]
1915
runs-on: ${{ matrix.os }}
2016
steps:
21-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
2218
- name: Set up Python ${{ matrix.python }}
23-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2420
with:
2521
python-version: ${{ matrix.python }}
22+
cache: 'pip'
2623
- name: Install dependencies
2724
run: |
2825
pip install --upgrade 'attrs==19.2.0' wheel -r requirements.txt
2926
- name: Install cli
3027
run: |
3128
pip install .
29+
- uses: actions/cache@v3
30+
with:
31+
path: ~/.cache/pre-commit/
32+
key: ${{ matrix.os }}-${{ env.pythonLocation }}${{ hashFiles('.pre-commit-config.yaml') }}
3233
- name: pre-commit, twine checks
3334
run: |
3435
pre-commit run --all-files

.github/workflows/pypi-release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- name: Set up Python 3.8
14-
uses: actions/setup-python@v2
14+
uses: actions/setup-python@v4
1515
with:
1616
python-version: 3.8
17+
cache: 'pip'
1718
- name: Install dependencies
1819
run: |
1920
pip install --upgrade wheel twine

.github/workflows/schema-updater.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
schema-updater:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- run: |
1111
curl https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-resource-schema/master/src/main/resources/schema/provider.definition.schema.v1.json > src/rpdk/core/data/schema/provider.definition.schema.v1.json
1212
- uses: peter-evans/create-pull-request@v3

0 commit comments

Comments
 (0)