diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 88ddfa4..c005bd8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,6 +15,7 @@ jobs: - linux/arm64 runs-on: ${{ matrix.platform == 'linux/amd64' && 'ubuntu-24.04' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }} name: build ${{ matrix.platform }} + timeout-minutes: 30 outputs: tag: ${{ steps.envvars.outputs.tag }} steps: @@ -56,6 +57,12 @@ jobs: tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }} outputs: type=image,push-by-digest=true,name-canonical=true,push=true + - name: Run tests + shell: bash + run: | + docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \ + mamba install -c conda-forge -y aiida-core; " + - name: Export digest run: | mkdir -p ${{ runner.temp }}/digests @@ -70,9 +77,10 @@ jobs: if-no-files-found: error retention-days: 1 - merge: + tags: + if: github.event_name != 'pull_request' runs-on: ubuntu-24.04 - name: merge into multiarch manifest + name: merge and tag needs: - build steps: @@ -100,7 +108,9 @@ jobs: uses: docker/metadata-action@v5.8.0 with: images: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }} - tags: dev + tags: | + latest + ${{ needs.build.outputs.tag }} - name: Create manifest list and push id: annotate @@ -124,52 +134,7 @@ jobs: - name: Inspect image run: | - docker buildx imagetools inspect ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev - - tests: - strategy: - fail-fast: false - matrix: - platform: - - linux/amd64 - - linux/arm64 - runs-on: ${{ matrix.platform == 'linux/amd64' && 'ubuntu-latest' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }} - name: testing on ${{ matrix.platform }} - timeout-minutes: 30 - needs: - - build - - merge - steps: - - - name: Test notebooks - shell: bash - run: | - docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev bash -c " \ - mamba install -c conda-forge -y aiida-core; " - - tags: - runs-on: ubuntu-24.04 - if: github.event_name != 'pull_request' - name: add tags - needs: - - build - - tests - steps: - - name: Authenticate with GHCR - id: auth - uses: docker/login-action@v3.5.0 - with: - registry: "ghcr.io" - username: ${{github.actor}} - password: ${{secrets.BUILD_TOKEN}} - - - name: tag release versions - shell: bash - run: | - docker buildx imagetools create \ - --tag ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest \ - --tag ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:${{ needs.build.outputs.tag }} \ - ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev + docker buildx imagetools inspect ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest - name: Post version update to dash uses: peter-evans/repository-dispatch@v3.0.0 @@ -206,7 +171,7 @@ jobs: "qmmm-workshop", "structure-validation-workshop", "ubiquitin-analysis-workshop"] - name: jupyterhub-${{ matrix.jupyter-base }} + name: trigger ${{ matrix.repo }} steps: - name: Trigger to build workshops uses: peter-evans/repository-dispatch@v3.0.0