fix: digest divergence on dual-push buildx builds #1520
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: unit-tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - src/** | |
| - tests/unit/** | |
| - config.nims | |
| - "*.nimble" | |
| # ignore docs not to waste CI minutes | |
| - "!src/docs/**" | |
| - Dockerfile | |
| pull_request: | |
| paths: | |
| - src/** | |
| - tests/unit/** | |
| - config.nims | |
| - "*.nimble" | |
| # ignore docs not to waste CI minutes | |
| - "!src/docs/**" | |
| - Dockerfile | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| unit-tests: | |
| if: | | |
| ( | |
| github.event_name == 'pull_request' && | |
| !contains(github.event.pull_request.body, format('skip:{0}', github.workflow)) | |
| ) || ( | |
| github.event_name == 'push' | |
| ) || ( | |
| github.event_name == 'workflow_dispatch' | |
| ) || ( | |
| github.event_name == 'schedule' | |
| ) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: linux | |
| runs-on: ubuntu-22.04 | |
| arch: x86_64 | |
| name: "${{ matrix.os }}-${{ matrix.arch }}" | |
| runs-on: ${{ matrix.runs-on }} | |
| concurrency: | |
| # only allow one job per PR running | |
| # older pending jobs will be cancelled not to waste CI minutes | |
| # cannot use github.job here https://github.com/community/community/discussions/13496 | |
| group: ${{ github.workflow }}-unit-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # 3.3.0 | |
| with: | |
| install: true | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # 3.2.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ github.token }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # 3.2.0 | |
| with: | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.DOCKER_HUB_PUBLIC_READONLY_TOKEN }} | |
| - name: Checkout sibling repos | |
| run: make nimble.paths | |
| - name: Bake images | |
| run: | | |
| docker buildx bake --allow=fs.read=../nimutils chalk --load | |
| - name: Run unit tests | |
| run: | | |
| make unit-tests |