Skip to content

Commit

Permalink
try new smoke tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ermirizio committed Nov 27, 2023
1 parent bf574f7 commit 6e9b653
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 55 deletions.
57 changes: 2 additions & 55 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -412,62 +412,9 @@ jobs:
context: "."
file: Dockerfile
push: false
smoke-tests:
needs:
- goreleaser
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 }} /* mdcb or dash */
run: |
set -eaxo pipefail
if [ ! -d smoke-tests ]; then
echo "::warning No repo specific smoke tests defined"
fi
if [ ! -d ci/tests ]; then
echo "::warning No ci tests defined"
exit 0
fi
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-pump:sha-${{ github.sha }}
cd -
fi
done
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-pump:sha-${{ github.sha }}
cd -
fi
done

smoke-test:
uses: ./.github/workflows/smoke-test.yml

sbom:
needs: goreleaser
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Smoke Tests

on:
workflow_call:

jobs:
smoke-tests:
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@v4
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@v2
with:
mask-password: 'true'

- name: Run smoke tests
shell: bash
run: |
set -eaxo pipefail
if [ ! -d smoke-tests ]; then
echo "::warning No repo specific smoke tests defined"
exit 0
fi
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 }}`}}/{{ .Name }}:sha-{{`${{ github.sha }}`}}
cd -
fi
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6e9b653

Please sign in to comment.