Tries using minified metadata #813
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| - target: i686-unknown-linux-musl | |
| os: ubuntu-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| name: "Building ${{matrix.target}}" | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{github.event.pull_request.head.sha || github.sha}} | |
| - uses: ./.github/actions/build | |
| id: build | |
| with: | |
| target: ${{matrix.target}} | |
| profile: release-lto-nodebug | |
| - name: "Build ${{steps.build.outputs.version}}" | |
| run: | | |
| # The binary was already built in the previous step but we must have a step | |
| # named exactly "Build <version>" to allow the Cloudflare workers to detect | |
| # the version of the commit. | |
| - name: "Generate an iso image for v86" | |
| if: matrix.target == 'i686-unknown-linux-musl' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install genisoimage | |
| cd target/${{matrix.target}}/release-lto-nodebug/ | |
| genisoimage -R -o yarn.iso {yarn,yarn-bin} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: yarn-${{matrix.target}} | |
| path: | | |
| target/${{matrix.target}}/release-lto-nodebug/yarn-bin | |
| target/${{matrix.target}}/release-lto-nodebug/yarn | |
| target/${{matrix.target}}/release-lto-nodebug/LICENSE.md | |
| - name: Upload iso image | |
| if: matrix.target == 'i686-unknown-linux-musl' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: yarn-${{matrix.target}}-iso | |
| path: target/${{matrix.target}}/release-lto-nodebug/yarn.iso | |
| test: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| name: "Testing ${{matrix.target}}" | |
| needs: [build] | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{github.event.pull_request.head.sha || github.sha}} | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: yarn-${{matrix.target}} | |
| path: artifacts | |
| - name: Prepare Node | |
| uses: ./.github/actions/prepare-node | |
| with: | |
| link: artifacts/yarn-bin | |
| - name: Generate the test report | |
| run: | | |
| export TEST_BINARY=$(pwd)/artifacts/yarn-bin | |
| yarn ./tests/acceptance-tests jest --json --outputFile=$(pwd)/report.json || true | |
| - name: Upload test report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: yarn-${{matrix.target}}-test-report | |
| path: report.json | |
| report: | |
| name: Reporting test results | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: test-reports | |
| url: >- | |
| ${{ | |
| github.event_name == 'pull_request' && | |
| format('https://iteratum.ai/examples/jest-ui/?url=https%3A%2F%2Frepo.yarnpkg.com%2Fbuilds%2Fzpm%2Fcommits%2F{0}%2Ftests&compareUrl=https%3A%2F%2Frepo.yarnpkg.com%2Fbuilds%2Fzpm%2Fcommits%2F{1}%2Ftests', github.event.pull_request.head.sha, steps.fork-point.outputs.result) || | |
| format('https://iteratum.ai/examples/jest-ui/?url=https%3A%2F%2Frepo.yarnpkg.com%2Fbuilds%2Fzpm%2Fcommits%2F{0}%2Ftests', github.sha) | |
| }} | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{github.event.pull_request.head.sha || github.sha}} | |
| - name: Retrieve the fork point for the pull request | |
| id: fork-point | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "result=$(git merge-base ${{github.event.pull_request.base.sha}} ${{github.event.pull_request.head.sha}})" >> $GITHUB_OUTPUT |