Skip to content

chore(ci): trigger #801

chore(ci): trigger

chore(ci): trigger #801

Workflow file for this run

name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches-ignore:
- 'release/**'
tags:
- 'nightly'
jobs:
build:
name: Build
uses: ./.github/workflows/.reusable_build.yml
secrets: inherit
build-test-image:
name: Build Test Image
uses: ./.github/workflows/.reusable_test_image.yml
needs: build
secrets: inherit
e2e-tests:
name: E2E Tests
needs: build-test-image
uses: ./.github/workflows/.reusable_e2e_tests.yml
secrets: inherit
with:
gateway-image: ${{ needs.build-test-image.outputs.image }}
load-test-image-from-artifact: true
e2e-tests-csp-on:
name: E2E Tests (CSP on)
needs: build-test-image
uses: ./.github/workflows/.reusable_e2e_tests.yml
secrets: inherit
with:
gateway-image: ${{ needs.build-test-image.outputs.image }}
load-test-image-from-artifact: true
enable-csp-header: true
create-release:
if: >-
github.event_name == 'push' && (
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/chore/ci-release'
)
name: Create Release
needs: [e2e-tests, e2e-tests-csp-on]
runs-on: ${{ vars.RUNS_ON }}
steps:
- name: Download release
timeout-minutes: 5
uses: actions/download-artifact@v4
with:
name: release
- name: Create nightly release
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/chore/ci-release'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
GH_REPOSITORY: ${{ github.repository }}
RELEASE_TAG_NAME: test-nightly
RELEASE_TARGET: ${{ github.sha }}
run: |
previous=$(
gh release view $RELEASE_TAG_NAME -R $GH_REPOSITORY >/dev/null 2>&1
if [[ $? == 0 ]]; then
echo true
else
echo false
fi
)
if $previous; then
echo "Deleting the existing release..."
gh release delete $RELEASE_TAG_NAME -R $GH_REPOSITORY --cleanup-tag -y
else
echo "No previous release found"
fi
echo "Deleting the associated tag..."
gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$GH_REPOSITORY/git/refs/tags/$RELEASE_TAG_NAME >/dev/null 2>&1 || true
echo "Creating a new release with assets..."
gh release create $RELEASE_TAG_NAME -t $RELEASE_TAG_NAME --target $RELEASE_TARGET -R $GH_REPOSITORY release.tar.gz
- name: Create non-nightly (tagged) release
if: startsWith(github.ref, 'refs/tags/')
shell: bash
env:
GH_TOKEN: ${{ github.token }}
GH_REPOSITORY: ${{ github.repository }}
RELEASE_TAG_NAME: ${{ github.ref_name }} # this is the tag name
RELEASE_TARGET: ${{ github.sha }}
run: |
# previous=$(
# gh release view $RELEASE_TAG_NAME -R $GH_REPOSITORY >/dev/null 2>&1
# if [[ $? == 0 ]]; then
# echo true
# else
# echo false
# fi
# )
# if $previous; then
# echo "Release already exists"
# echo "Replacing assets..."
# gh release upload $RELEASE_TAG_NAME release.tar.gz --clobber -R $GH_REPOSITORY
# else
# echo "No previous release found"
# echo "Creating a new release with assets..."
# gh release create $RELEASE_TAG_NAME -t $RELEASE_TAG_NAME --target $RELEASE_TARGET -R $GH_REPOSITORY release.tar.gz
# fi