Skip to content

Commit

Permalink
Extract release tests from release.yml into release-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Tit Petric authored and titpetric committed Nov 28, 2023
1 parent 058c1a4 commit 7e22bb0
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 62 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Run CI tests and smoke tests

jobs:
smoke-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::754489498669:role/ecr_rw_tyk
role-session-name: cipush
aws-region: eu-central-1

- id: ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'

- name: Run ci/tests
shell: bash
env:
GITHUB_TAG: ${{ github.ref }}
GATEWAY_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
PLUGIN_COMPILER_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk-plugin-compiler:sha-${{ github.sha }}
run: |
set -eaxo pipefail
for d in ci/tests/*/
do
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
cd -
fi
done
- name: Run smoke-tests

# This job only runs whenever a tag is created. A tag is required
# for a functional plugin compiler build for when the GO_GET=1 env
# is provided. The plugin compiler cannot fetch the referenced
# commit from a PR, but requires a /heads or /tags reference.
#
# See https://github.com/golang/go/issues/31191 for more info.

if: startsWith(github.ref, 'refs/tags')
shell: bash
env:
GITHUB_TAG: ${{ github.ref }}
GATEWAY_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
PLUGIN_COMPILER_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk-plugin-compiler:sha-${{ github.sha }}
run: |
set -eaxo pipefail
for d in smoke-tests/*/
do
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
cd -
fi
done
63 changes: 1 addition & 62 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -444,68 +444,7 @@ jobs:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::754489498669:role/ecr_rw_tyk
role-session-name: cipush
aws-region: eu-central-1

- id: ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'

- name: Run ci/tests
shell: bash
env:
GITHUB_TAG: ${{ github.ref }}
GATEWAY_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
PLUGIN_COMPILER_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk-plugin-compiler:sha-${{ github.sha }}
run: |
set -eaxo pipefail
for d in ci/tests/*/
do
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
cd -
fi
done
- name: Run smoke-tests

# This job only runs whenever a tag is created. A tag is required
# for a functional plugin compiler build for when the GO_GET=1 env
# is provided. The plugin compiler cannot fetch the referenced
# commit from a PR, but requires a /heads or /tags reference.
#
# See https://github.com/golang/go/issues/31191 for more info.

if: startsWith(github.ref, 'refs/tags')
shell: bash
env:
GITHUB_TAG: ${{ github.ref }}
GATEWAY_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
PLUGIN_COMPILER_IMAGE: ${{ steps.ecr.outputs.registry }}/tyk-plugin-compiler:sha-${{ github.sha }}
run: |
set -eaxo pipefail
for d in smoke-tests/*/
do
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ steps.ecr.outputs.registry }}/tyk:sha-${{ github.sha }}
cd -
fi
done
uses: ./.github/workflows/release-tests.yml

sbom:
needs: goreleaser
Expand Down

0 comments on commit 7e22bb0

Please sign in to comment.