Skip to content

Commit 7cbbdbd

Browse files
authored
chore: Split workflows and simplify testing (#67)
The CI workflow has been split into separate CI and PR workflows, and the number of Terraform versions that are tested whenever changes are made to the module has been reduced, Terraform uses semantic versioning so we will only test against the latest major.minor versions.
1 parent 801d242 commit 7cbbdbd

File tree

2 files changed

+34
-29
lines changed

2 files changed

+34
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
name: CI
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
7-
paths-ignore:
8-
- .editorconfig
9-
- .gitignore
10-
- CHANGELOG.md
11-
- LICENSE.md
12-
- README.md
134
push:
145
branches:
156
- main
@@ -18,6 +9,7 @@ on:
189
- .gitignore
1910
- CHANGELOG.md
2011
- LICENSE.md
12+
- Makefile
2113
- README.md
2214

2315
jobs:
@@ -30,35 +22,17 @@ jobs:
3022
- name: Setup Terraform
3123
uses: hashicorp/setup-terraform@v3
3224
with:
33-
terraform_version: ${{ matrix.terraform_version }}
25+
terraform_version: "1.10"
3426
- name: Initialise with no backend
3527
run: terraform init -backend=false
3628
- name: Check formatting
3729
run: terraform fmt -check -recursive
3830
- name: Validate the configuration
3931
run: terraform validate
40-
strategy:
41-
matrix:
42-
terraform_version: [ "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6" ]
43-
44-
caller-identity:
45-
if: ${{ github.event_name == 'push' }}
46-
name: Return the IAM user
47-
permissions:
48-
contents: read
49-
id-token: write
50-
runs-on: ubuntu-latest
51-
steps:
52-
- name: Configure AWS credentials
53-
uses: aws-actions/configure-aws-credentials@v4
54-
with:
55-
aws-region: ${{ secrets.AWS_REGION }}
56-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github
57-
- run: aws sts get-caller-identity
5832

5933
release:
6034
name: Release?
61-
needs: [ caller-identity ]
35+
needs: [ verify ]
6236
permissions:
6337
contents: write
6438
pull-requests: write

.github/workflows/pr.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- .editorconfig
9+
- .gitignore
10+
- CHANGELOG.md
11+
- LICENSE.md
12+
- Makefile
13+
- README.md
14+
15+
jobs:
16+
verify:
17+
name: Verify
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
- name: Setup Terraform
23+
uses: hashicorp/setup-terraform@v3
24+
with:
25+
terraform_version: "1.10"
26+
- name: Initialise with no backend
27+
run: terraform init -backend=false
28+
- name: Check formatting
29+
run: terraform fmt -check -recursive
30+
- name: Validate the configuration
31+
run: terraform validate

0 commit comments

Comments
 (0)