Release 7.0.2 #32
Workflow file for this run
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: Build | |
| permissions: {} | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - develop | |
| tags: | |
| - '*' | |
| jobs: | |
| Bats: | |
| name: Shell library tests (BATS) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build test image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./tests/Dockerfile | |
| push: false | |
| load: true | |
| tags: wordpress-bats-test:${{ github.run_id }} | |
| - name: Run BATS tests | |
| run: docker run --rm wordpress-bats-test:${{ github.run_id }} | |
| E2E: | |
| name: Legacy upgrade end-to-end test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: false | |
| load: true | |
| platforms: linux/amd64 | |
| tags: wordpress-e2e-test:${{ github.run_id }} | |
| - name: Run legacy-install upgrade regression test | |
| run: ./tests/e2e-legacy-upgrade.sh wordpress-e2e-test:${{ github.run_id }} | |
| Container: | |
| name: Build Container Image | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCKERFILE: ./Dockerfile | |
| DOCKER_IMAGE_NAME: cloudtooling/wordpress | |
| VERSION_FILE: config.json | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Write version vars | |
| id: version-vars | |
| run: | | |
| BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` | |
| BRANCH=${GITHUB_REF_NAME#v} | |
| APP_VERSION=$(cat $VERSION_FILE | grep version| head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | sed 's/ //g') | |
| echo Version: $APP_VERSION | |
| /bin/cat <<EOM >>$GITHUB_ENV | |
| VERSION=$APP_VERSION | |
| APP_VERSION=$APP_VERSION | |
| BUILD_DATE=$BUILD_DATE | |
| EOM | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ vars.DOCKER_HUB_USER }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: Build Docker image | |
| id: build-image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ${{env.DOCKERFILE}} | |
| push: false | |
| tags: | | |
| ${{env.DOCKER_IMAGE_NAME}}:latest | |
| ${{env.DOCKER_IMAGE_NAME}}:next | |
| ${{env.DOCKER_IMAGE_NAME}}:${{ github.run_id }} | |
| ${{env.DOCKER_IMAGE_NAME}}:${{ env.APP_VERSION }} | |
| build-args: | | |
| BUILD_DATE=${{env.BUILD_DATE}} | |
| APP_VERSION=${{env.APP_VERSION}} | |
| platforms: linux/amd64,linux/arm64 | |
| if: github.ref_type != 'tag' | |
| - name: Push To Docker Hub | |
| id: push-to-dockerhub-preview | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ${{env.DOCKERFILE}} | |
| push: true | |
| tags: | | |
| ${{env.DOCKER_IMAGE_NAME}}:next | |
| ${{env.DOCKER_IMAGE_NAME}}:${{ github.run_id }} | |
| build-args: | | |
| BUILD_DATE=${{env.BUILD_DATE}} | |
| APP_VERSION=${{env.APP_VERSION}} | |
| platforms: linux/amd64,linux/arm64 | |
| if: github.ref_type != 'tag' | |
| - name: Push To Docker Hub | |
| id: push-to-dockerhub-tagged | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ${{env.DOCKERFILE}} | |
| push: true | |
| tags: | | |
| ${{env.DOCKER_IMAGE_NAME}}:latest | |
| ${{env.DOCKER_IMAGE_NAME}}:${{ github.run_id }} | |
| ${{env.DOCKER_IMAGE_NAME}}:${{ env.APP_VERSION }} | |
| build-args: | | |
| BUILD_DATE=${{env.BUILD_DATE}} | |
| APP_VERSION=${{env.BRANCH}} | |
| platforms: linux/amd64,linux/arm64 | |
| if: github.ref_type == 'tag' || github.tag != '' | |
| Build-results: | |
| name: Build results | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - Bats | |
| - E2E | |
| - Container | |
| steps: | |
| - run: exit 1 | |
| # see https://stackoverflow.com/a/67532120/4907315 | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') | |
| || contains(needs.*.result, 'cancelled') | |
| || contains(needs.*.result, 'skipped') | |
| }} |