Skip to content

Commit f13ed70

Browse files
committed
refactor: Use one workflow for PRs and pushes
1 parent 2916e5c commit f13ed70

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
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+
- Makefile
13+
- README.md
414
push:
515
branches:
616
- main
@@ -29,9 +39,12 @@ jobs:
2939
run: terraform fmt -check -recursive
3040
- name: Validate the configuration
3141
run: terraform validate
42+
- name: Run unit tests
43+
run: terraform test
3244

3345
release:
3446
name: Release?
47+
if: github.event == 'push'
3548
needs: [ verify ]
3649
permissions:
3750
contents: write

oidc-github.tftest.hcl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
provider "aws" {
2+
region = "eu-west-1"
3+
}
4+
5+
run "single_github_repository_no_branch_specified" {
6+
variables {
7+
github_repositories = ["unfunco/terraform-aws-oidc-github"]
8+
}
9+
10+
command = plan
11+
12+
assert {
13+
condition = aws_s3_bucket.bucket.bucket == "test-bucket"
14+
error_message = "S3 bucket name did not match expected"
15+
}
16+
}

0 commit comments

Comments
 (0)