diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46c44faf6..419f5b220 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml new file mode 100644 index 000000000..b48f31d9d --- /dev/null +++ b/.github/workflows/smoke-test.yml @@ -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 diff --git a/ci/tests/csvpump/confs/tyk-pump.conf b/ci/smoke-tests/csvpump/confs/tyk-pump.conf similarity index 100% rename from ci/tests/csvpump/confs/tyk-pump.conf rename to ci/smoke-tests/csvpump/confs/tyk-pump.conf diff --git a/ci/tests/csvpump/confs/tyk.conf b/ci/smoke-tests/csvpump/confs/tyk.conf similarity index 100% rename from ci/tests/csvpump/confs/tyk.conf rename to ci/smoke-tests/csvpump/confs/tyk.conf diff --git a/ci/tests/csvpump/data/api.authenabled.json b/ci/smoke-tests/csvpump/data/api.authenabled.json similarity index 100% rename from ci/tests/csvpump/data/api.authenabled.json rename to ci/smoke-tests/csvpump/data/api.authenabled.json diff --git a/ci/tests/csvpump/data/key.json b/ci/smoke-tests/csvpump/data/key.json similarity index 100% rename from ci/tests/csvpump/data/key.json rename to ci/smoke-tests/csvpump/data/key.json diff --git a/ci/tests/csvpump/data/org.json b/ci/smoke-tests/csvpump/data/org.json similarity index 100% rename from ci/tests/csvpump/data/org.json rename to ci/smoke-tests/csvpump/data/org.json diff --git a/ci/tests/csvpump/docker-compose.yml b/ci/smoke-tests/csvpump/docker-compose.yml similarity index 100% rename from ci/tests/csvpump/docker-compose.yml rename to ci/smoke-tests/csvpump/docker-compose.yml diff --git a/ci/tests/csvpump/test.sh b/ci/smoke-tests/csvpump/test.sh similarity index 100% rename from ci/tests/csvpump/test.sh rename to ci/smoke-tests/csvpump/test.sh