diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6845596..2ec44a9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,6 +7,7 @@ on: jobs: build: + timeout-minutes: 360 strategy: fail-fast: false matrix: @@ -60,6 +61,13 @@ jobs: tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }} outputs: type=image,push-by-digest=true,name-canonical=true,push=true + - name: Test notebooks + shell: bash + run: | + docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \ + pip install pytest nbmake; \ + find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;" + - name: Export digest run: | mkdir -p ${{ runner.temp }}/digests @@ -74,9 +82,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: @@ -104,7 +113,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 @@ -128,53 +139,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: 360 - 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 " \ - pip install pytest nbmake; \ - find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;" - - 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