Skip to content

Commit

Permalink
ci: use reusable integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Pivkin <[email protected]>
  • Loading branch information
nikpivkin authored and simar7 committed Feb 28, 2025
1 parent 6ac6291 commit 401968d
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 49 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Reusable Integration Tests
on:
workflow_call:

env:
GO_VERSION: "1.23"

jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run integration tests
run: make test-integration
4 changes: 2 additions & 2 deletions .github/workflows/outdated-api-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
contents: write

env:
GO_VERSION: '1.23'
GO_VERSION: "1.23"

jobs:
outdated:
Expand All @@ -33,7 +33,7 @@ jobs:
OUTDATE_API_DATA: ${{ toJson(steps.outdatedapi.outputs.response) }}
run: |
make outdated-api-updated
- name: Setup OPA
uses: ./.github/actions/setup-opa

Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/reusable-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,10 @@ on:
env:
GH_USER: aqua-bot
AQUA_DOCKERHUB_REPO: aquasec
GO_VERSION: "1.23"

jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run integration tests
run: make test-integration
uses: ./.github/workflows/integration-tests.yaml

release:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
merge_group:

env:
GO_VERSION: '1.23'
GO_VERSION: "1.23"

jobs:
opa-tests:
Expand Down
31 changes: 10 additions & 21 deletions .github/workflows/test-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,22 @@ on:
merge_group:

env:
GO_VERSION: '1.23'
GO_VERSION: "1.23"

jobs:
build:
name: Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run tests
run: make test
shell: bash

integration:
name: Integration Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run integration tests
run: make test-integration
- name: Run tests
run: make test
shell: bash

integration-tests:
uses: ./.github/workflows/integration-tests.yaml
4 changes: 2 additions & 2 deletions .github/workflows/test-rego.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Rego Check
run: go run ./cmd/opa check lib checks --strict --v0-v1

- name: Setup Regal
- name: Setup Regal
uses: StyraInc/setup-regal@33a142b1189004e0f14bf42b15972c67eecce776 # v1
with:
version: 0.29
Expand All @@ -48,4 +48,4 @@ jobs:
fi
- name: Test Rego checks
run: make test-rego
run: make test-rego
22 changes: 11 additions & 11 deletions .github/workflows/verify-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ on:
merge_group:

env:
GO_VERSION: '1.23'
GO_VERSION: "1.23"

jobs:
build:
name: Verify Docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- run: |
make docs
if [ -n "$(git status --porcelain)" ]; then
echo "Run 'make docs' and push it"
exit 1
fi
- run: |
make docs
if [ -n "$(git status --porcelain)" ]; then
echo "Run 'make docs' and push it"
exit 1
fi

0 comments on commit 401968d

Please sign in to comment.