Skip to content

Commit

Permalink
test: use centralized GH actions
Browse files Browse the repository at this point in the history
Signed-off-by: Flavio Castelli <[email protected]>
  • Loading branch information
flavio committed Sep 17, 2024
1 parent 369aa2f commit b26baf2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 65 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ name: Release policy
jobs:
test:
name: run tests and linters
uses: ./.github/workflows/test.yml
uses: kubewarden/github-actions/.github/workflows/[email protected]
with:
artifacthub: false

release:
runs-on: ubuntu-latest
needs: test

permissions:
# Required to create GH releases
contents: write
Expand All @@ -24,23 +24,7 @@ jobs:
# Required by cosign keyless signing
id-token: write

steps:
- name: Install dependencies
uses: kubewarden/github-actions/[email protected]

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.21"

- run: make annotated-policy.wasm
- name: Run e2e tests
run: |
make e2e-tests
- name: Release
uses: kubewarden/github-actions/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
oci-target: ghcr.io/${{ github.repository_owner }}/tests/raw-validation-wasi-policy
artifacthub: false
uses: kubewarden/github-actions/.github/workflows/[email protected]
with:
oci-target: ghcr.io/${{ github.repository_owner }}/tests/raw-validation-wasi-policy
artifacthub: false
47 changes: 5 additions & 42 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,8 @@
on:
push:
pull_request:
workflow_call:

on: [push, pull_request]
name: Continuous integration
jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.21"
- run: make test

e2e-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.21"
- name: Setup BATS
uses: mig4/setup-bats@af9a00deb21b5d795cabfeaa8d9060410377686d # v1.2.0
with:
bats-version: 1.11.0
- name: Install kwctl
uses: kubewarden/github-actions/[email protected]
- run: make e2e-tests

golangci:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.21"
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: v1.53.3
name: run tests and linters
uses: kubewarden/github-actions/.github/workflows/[email protected]
with:
artifacthub: false

0 comments on commit b26baf2

Please sign in to comment.