Skip to content

Commit f4b78de

Browse files
BAM: Updated gempush.yml to run tests and linting on PRs (#567)
* BAM: Updated gempush.yml to run tests and linting on PRs * BAM: Updated list of events to run workflow on * BAM: Moving tests and linting to it's own workflow to run on master and PRs * Trigger Build * Adjust workflow name, add back tests to primary workflow * Restrict permissions on linting workflow * Trigger Build * BAM: Attempting to call a workflow from a workflow * BAM: Fix needs statement * BAM: Adding to tests-linting * BAM: Removing requirement for secrets Co-authored-by: Kevin Formsma <[email protected]>
1 parent 1893b15 commit f4b78de

File tree

2 files changed

+58
-41
lines changed

2 files changed

+58
-41
lines changed

.github/workflows/gempush.yml

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,12 @@ env:
88
docker_org: stelligent
99

1010
jobs:
11-
commit:
12-
name: Commit
13-
runs-on: ubuntu-latest
14-
strategy:
15-
fail-fast: false # Allows both ruby versions to run before failing
16-
matrix:
17-
ruby: ['2.5', '3.0']
18-
19-
steps:
20-
- uses: actions/checkout@master
21-
- name: Set up Ruby
22-
uses: ruby/setup-ruby@v1
23-
with:
24-
ruby-version: ${{ matrix.ruby }}
25-
bundler-cache: true
26-
- name: Rubocop lint
27-
run: bundle exec rubocop -D
28-
- name: Rspec tests
29-
run: bundle exec rspec --require spec_helper spec
30-
- name: Duplicate rule check
31-
run: bundle exec ./bin/cfn_nag_rules
32-
33-
acceptance:
34-
name: Acceptance
35-
runs-on: ubuntu-latest
36-
strategy:
37-
fail-fast: false # Allows both ruby versions to run before failing
38-
matrix:
39-
ruby: ['2.5', '3.0']
40-
41-
steps:
42-
# is this the same commit hash we saw in commit?
43-
- uses: actions/checkout@master
44-
- name: Set up Ruby
45-
uses: ruby/setup-ruby@v1
46-
with:
47-
ruby-version: ${{ matrix.ruby }}
48-
- name: e2e
49-
run: bash ./scripts/setup_and_run_end_to_end_tests.sh
50-
11+
tests-linting:
12+
uses: stelligent/cfn_nag/.github/workflows/tests-linting.yml@master
5113
release:
5214
name: Release
5315
runs-on: ubuntu-latest
54-
needs: [commit, acceptance]
16+
needs: [tests-linting]
5517
steps:
5618
# is this the same commit hash we saw in commit?
5719
- uses: actions/checkout@v2
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: test-lint
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
permissions:
11+
contents: read
12+
13+
env:
14+
docker_org: stelligent
15+
16+
jobs:
17+
tests-linting:
18+
name: Tests & Linting
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false # Allows both ruby versions to run before failing
22+
matrix:
23+
ruby: ['2.5', '3.0']
24+
25+
steps:
26+
- uses: actions/checkout@master
27+
- name: Set up Ruby
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ${{ matrix.ruby }}
31+
bundler-cache: true
32+
- name: Rubocop lint
33+
run: bundle exec rubocop -D
34+
- name: Rspec tests
35+
run: bundle exec rspec --require spec_helper spec
36+
- name: Duplicate rule check
37+
run: bundle exec ./bin/cfn_nag_rules
38+
39+
acceptance:
40+
name: Acceptance
41+
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: false # Allows both ruby versions to run before failing
44+
matrix:
45+
ruby: ['2.5', '3.0']
46+
47+
steps:
48+
# is this the same commit hash we saw in commit?
49+
- uses: actions/checkout@master
50+
- name: Set up Ruby
51+
uses: ruby/setup-ruby@v1
52+
with:
53+
ruby-version: ${{ matrix.ruby }}
54+
- name: e2e
55+
run: bash ./scripts/setup_and_run_end_to_end_tests.sh

0 commit comments

Comments
 (0)