diff --git a/.github/CARGO_PUBLISH_DRY_RUN_ISSUE_TEMPLATE.md b/.github/CARGO_PUBLISH_DRY_RUN_ISSUE_TEMPLATE.md new file mode 100644 index 00000000000..d18529deed3 --- /dev/null +++ b/.github/CARGO_PUBLISH_DRY_RUN_ISSUE_TEMPLATE.md @@ -0,0 +1,8 @@ +--- +title: "[automated] `cargo publish --dry-run` failure @ {{ date | date('D/M/YY HH:mm') }}" +labels: ["Bug"] +--- + +## Description + +Please [check the logs]({{ env.WORKFLOW_URL }}) for more information. diff --git a/.github/workflows/cargo-publish-dry-run.yml b/.github/workflows/cargo-publish-dry-run.yml new file mode 100644 index 00000000000..571ad1c0f51 --- /dev/null +++ b/.github/workflows/cargo-publish-dry-run.yml @@ -0,0 +1,47 @@ +name: cargo publish dry run +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +env: + CI: 1 + CACHE_TIMEOUT_MINUTES: 5 + AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" + RUSTC_WRAPPER: sccache + CC: sccache clang + CXX: sccache clang++ + +jobs: + cargo-publish-dry-run: + runs-on: ubuntu-24.04-arm + steps: + - name: Configure SCCache variables + run: | + # External PRs do not have access to 'vars' or 'secrets'. + if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + fi + - name: Checkout Sources + uses: actions/checkout@v6 + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.9 + timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }} + continue-on-error: true + - uses: jdx/mise-action@v4 + - run: cargo publish --dry-run + - name: Set WORKFLOW_URL + if: failure() + run: | + export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" + echo ${WORKFLOW_URL} + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + - uses: JasonEtco/create-an-issue@v2 + if: failure() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + filename: .github/CARGO_PUBLISH_DRY_RUN_ISSUE_TEMPLATE.md diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3f7240523ce..5f1522dcbbc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -50,6 +50,16 @@ jobs: - uses: actions/checkout@v6 - uses: jdx/mise-action@v4 - uses: taiki-e/install-action@cargo-llvm-cov + - uses: actions/cache@v5 + id: cache-proof-params + with: + path: ${{ env.FIL_PROOFS_PARAMETER_CACHE }} + key: proof-params-keys + - uses: actions/cache@v5 + id: cache-actor-bundle + with: + path: ${{ env.FOREST_ACTOR_BUNDLE_PATH }} + key: actor-bundle - name: Fetch proof params and RPC test snapshots run: | cargo run --bin forest-dev --no-default-features --profile quick -- fetch-test-snapshots --actor-bundle $FOREST_ACTOR_BUNDLE_PATH diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e498944f35e..b44ff2265da 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -50,10 +50,6 @@ jobs: echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV fi - - run: lscpu - - name: Show IP - run: curl ifconfig.me - continue-on-error: true - name: Checkout Sources uses: actions/checkout@v6 - name: Setup sccache @@ -65,7 +61,7 @@ jobs: env: # To minimize compile times: https://nnethercote.github.io/perf-book/build-configuration.html#minimizing-compile-times RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld" - run: mise run install release + run: mise run install ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && 'release' || 'quick' }} - uses: actions/upload-artifact@v7 with: name: "forest-linux-amd64" @@ -90,11 +86,6 @@ jobs: echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV fi echo "SCCACHE_S3_KEY_PREFIX=aarch64" >> $GITHUB_ENV - - run: lscpu - - run: vmstat -s - - name: Show IP - run: curl ifconfig.me - continue-on-error: true - name: Checkout Sources uses: actions/checkout@v6 if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') @@ -196,6 +187,7 @@ jobs: # - date+sha, e.g. 2023-01-19-da4692d, # - tag (if pushed). - name: Docker Meta + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') id: meta uses: docker/metadata-action@v6 with: @@ -208,13 +200,13 @@ jobs: type=edge - name: Build slim image and push to GitHub Container Registry + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') uses: docker/build-push-action@v7 with: context: /tmp/forest file: ./Dockerfile-ci tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} - # Compile Docker image only for AMD64 for a regular PR to save some CI time. - platforms: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && 'linux/amd64,linux/arm64' || 'linux/amd64' }} + push: true + platforms: linux/amd64,linux/arm64 target: slim-image diff --git a/.github/workflows/forest.yml b/.github/workflows/forest.yml index 2bfc277c960..6b620aa3f8e 100644 --- a/.github/workflows/forest.yml +++ b/.github/workflows/forest.yml @@ -74,10 +74,6 @@ jobs: echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV fi - - run: lscpu - - name: Show IP - run: curl ifconfig.me - continue-on-error: true - name: Checkout Sources uses: actions/checkout@v6 - name: Setup sccache @@ -103,24 +99,12 @@ jobs: path: | ~/.cargo/bin/forest* if-no-files-found: error - cargo-publish-dry-run: - runs-on: ubuntu-24.04 - steps: - - name: Checkout Sources - uses: actions/checkout@v6 - - name: Setup sccache - uses: mozilla-actions/sccache-action@v0.0.9 - timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }} - continue-on-error: true - - uses: jdx/mise-action@v4 - - run: cargo publish --dry-run forest-cli-check: needs: - build-ubuntu name: Forest CLI checks runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: ${{ env.FIL_PROOFS_PARAMETER_CACHE }} @@ -142,16 +126,11 @@ jobs: name: Calibnet check runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" key: proof-params-keys - uses: actions/checkout@v6 - - uses: actions/download-artifact@v8 - with: - name: "forest-${{ runner.os }}" - path: ~/.cargo/bin - uses: actions/download-artifact@v8 with: name: "forest-${{ runner.os }}" @@ -178,7 +157,6 @@ jobs: name: Calibnet stateless mode check runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -189,10 +167,6 @@ jobs: with: name: "forest-${{ runner.os }}" path: ~/.cargo/bin - - uses: actions/download-artifact@v8 - with: - name: "forest-${{ runner.os }}" - path: ~/.cargo/bin - name: Set permissions run: | chmod +x ~/.cargo/bin/forest* @@ -204,7 +178,6 @@ jobs: name: Calibnet stateless RPC check runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -215,10 +188,6 @@ jobs: with: name: "forest-${{ runner.os }}" path: ~/.cargo/bin - - uses: actions/download-artifact@v8 - with: - name: "forest-${{ runner.os }}" - path: ~/.cargo/bin - name: Set permissions run: | chmod +x ~/.cargo/bin/forest* @@ -230,7 +199,6 @@ jobs: name: State migrations runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -252,7 +220,6 @@ jobs: name: Wallet tests runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -281,7 +248,6 @@ jobs: name: Delegated wallet tests runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -309,7 +275,6 @@ jobs: name: V1 snapshot export checks runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -331,7 +296,6 @@ jobs: name: V2 snapshot export checks runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -353,7 +317,6 @@ jobs: name: Diff snapshot export checks runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -375,7 +338,6 @@ jobs: name: Calibnet no discovery checks runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -396,7 +358,6 @@ jobs: name: Calibnet kademlia checks runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -417,7 +378,6 @@ jobs: name: Calibnet eth mapping check runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -428,10 +388,6 @@ jobs: with: name: "forest-${{ runner.os }}" path: ~/.cargo/bin - - uses: actions/download-artifact@v8 - with: - name: "forest-${{ runner.os }}" - path: ~/.cargo/bin - name: Set permissions run: | chmod +x ~/.cargo/bin/forest* @@ -447,7 +403,6 @@ jobs: name: Calibnet api test-stateful check runs-on: ubuntu-24.04 steps: - - run: lscpu - uses: actions/cache@v5 with: path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" @@ -458,10 +413,6 @@ jobs: with: name: "forest-${{ runner.os }}" path: ~/.cargo/bin - - uses: actions/download-artifact@v8 - with: - name: "forest-${{ runner.os }}" - path: ~/.cargo/bin - name: Set permissions run: | chmod +x ~/.cargo/bin/forest* @@ -668,7 +619,6 @@ jobs: needs: - build-macos - build-ubuntu - - cargo-publish-dry-run - forest-cli-check - calibnet-check - calibnet-stateless-mode-check diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 5db900a3b43..26d07e4d514 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -56,10 +56,6 @@ jobs: echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV fi - # find the nearest S3 space for storing cache files - - name: Show IP - run: curl ifconfig.me - continue-on-error: true - name: Checkout Sources uses: actions/checkout@v6 - name: Setup sccache @@ -72,6 +68,16 @@ jobs: cache-dependency-path: "**/go.sum" - name: install nextest uses: taiki-e/install-action@nextest + - uses: actions/cache@v5 + id: cache-proof-params + with: + path: ${{ env.FIL_PROOFS_PARAMETER_CACHE }} + key: proof-params-keys + - uses: actions/cache@v5 + id: cache-actor-bundle + with: + path: ${{ env.FOREST_ACTOR_BUNDLE_PATH }} + key: actor-bundle - name: Fetch proof params and RPC test snapshots run: | cargo run --bin forest-dev --no-default-features --profile quick-test -- fetch-test-snapshots --actor-bundle $FOREST_ACTOR_BUNDLE_PATH