From 1ae4c4cfb5cf64454865a2ff7bfa5c289a90fbbd Mon Sep 17 00:00:00 2001 From: Mantra Date: Tue, 3 Dec 2024 15:28:36 +0000 Subject: [PATCH] put all in single workflow --- .github/workflows/build.yml | 30 ------------------------------ .github/workflows/test.yml | 28 +++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index b704ed16..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: build - -on: [push] - -env: - TAG_GHCR: mrc-ide/wodin - -jobs: - build-and-push: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - id: ci-env - uses: ./.github/actions/ci-env-and-ghcr-login - with: - ghcr-username: ${{ github.actor }} - ghcr-password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push docker - uses: docker/build-push-action@v5 - with: - file: ./docker/Dockerfile - push: true - tags: | - ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_SHA}} - ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_BRANCH}} - - name: Smoke test - run: | - ./scripts/run-version.sh --app ${{steps.ci-env.outputs.CI_BRANCH}} & - ./scripts/smoke-test.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 986c6141..2c1c5a2f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,33 @@ name: test on: [push] +env: + TAG_GHCR: mrc-ide/wodin + jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - id: ci-env + uses: ./.github/actions/ci-env-and-ghcr-login + with: + ghcr-username: ${{ github.actor }} + ghcr-password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push docker + uses: docker/build-push-action@v5 + with: + file: ./docker/Dockerfile + push: true + tags: | + ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_SHA}} + ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_BRANCH}} + - name: Smoke test + run: | + ./scripts/run-version.sh --app ${{steps.ci-env.outputs.CI_BRANCH}} & + ./scripts/smoke-test.sh + fe-unit-tests: runs-on: ubuntu-latest steps: @@ -87,7 +113,7 @@ jobs: publish-latest-image: runs-on: ubuntu-latest if: github.ref == 'refs/heads/mrc-5976' - needs: [lint] + needs: [lint, build-and-push] steps: - name: Publish image manifest to latest run: |