Tighten release tag filter in galexie workflow (#75) #194
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Galexie | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release/**' | |
| tags: | |
| - 'galexie-v[0-9]+.[0-9]+.[0-9]+' | |
| - 'galexie-v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | |
| pull_request: | |
| jobs: | |
| integration-test: | |
| name: Run tests - ${{ matrix.storage_type }} integration | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| storage_type: [ GCS, S3, Filesystem ] | |
| env: | |
| CAPTIVE_CORE_DEBIAN_PKG_VERSION: 26.1.0-3210.427aa3978.noble | |
| GALEXIE_INTEGRATION_TESTS_ENABLED: "true" | |
| GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core | |
| # this pins to a version of quickstart:testing that has the same version as GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN | |
| # this is the multi-arch index sha, get it by 'docker buildx imagetools inspect stellar/quickstart:future' | |
| GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE: stellar/quickstart:pr799-future | |
| GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL: "false" | |
| GALEXIE_INTEGRATION_TESTS_LOCALSTACK_IMAGE_TAG: "4.6.0" | |
| GALEXIE_INTEGRATION_TESTS_LOCALSTACK_IMAGE_PULL: "false" | |
| steps: | |
| - name: Install captive core | |
| run: | | |
| sudo wget -qO - https://apt.stellar.org/SDF.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=true sudo apt-key add - | |
| sudo bash -c 'echo "deb https://apt.stellar.org noble unstable" > /etc/apt/sources.list.d/SDF-unstable.list' | |
| sudo apt-get update && sudo apt-get install -y stellar-core="$CAPTIVE_CORE_DEBIAN_PKG_VERSION" | |
| echo "Using stellar core version $(stellar-core version)" | |
| - name: Pull Quickstart image | |
| shell: bash | |
| run: docker pull "$GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE" | |
| - name: Pull LocalStack image (for S3) | |
| if: ${{ matrix.storage_type == 'S3' }} | |
| shell: bash | |
| run: docker pull localstack/localstack:${GALEXIE_INTEGRATION_TESTS_LOCALSTACK_IMAGE_TAG} | |
| - uses: actions/checkout@v5 | |
| with: | |
| # For pull requests, build and test the PR head not a merge of the PR with the destination. | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Run tests - ${{ matrix.storage_type }} integration | |
| run: go test -v -race -run "TestGalexie${{ matrix.storage_type }}TestSuite" ./test/... | |
| publish-sha-tag-image: | |
| name: Push sha tag container image | |
| needs: integration-test | |
| if: ${{ github.event_name != 'pull_request' && github.ref_type != 'tag' }} | |
| runs-on: ubuntu-24.04 | |
| env: | |
| # this is the version of core to be bundled with galaxie on image | |
| STELLAR_CORE_VERSION: 26.1.0-3210.427aa3978.noble | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build docker | |
| run: make docker-build | |
| - name: Push sha tag image to DockerHub | |
| run: make docker-push | |
| publish-release-tag-image: | |
| name: Push release tag container image | |
| needs: integration-test | |
| if: github.ref_type == 'tag' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set RELEASE_VERSION | |
| run: | | |
| echo "RELEASE_VERSION=${GITHUB_REF_NAME#galexie-v}" >> $GITHUB_ENV | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Pull git sha tag image | |
| run: make docker-pull | |
| - name: Push release tag image | |
| run: make docker-push-release | |
| - name: Push latest tag to DockerHub | |
| if: ${{ ! contains(github.ref, '-rc') }} | |
| run: make docker-push-latest | |
| complete: | |
| if: always() | |
| needs: [integration-test] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
| run: exit 1 |