From ce19ba789a899bdd370feb554fe4bc1fe4d387e3 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 8 Oct 2024 17:39:24 +0200 Subject: [PATCH 1/7] [ci] Move test-linux-stable-no-try-runtime to GHA --- .github/workflows/tests-linux-stable.yml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml index 599edd8e69a1b..1c929951fa0d7 100644 --- a/.github/workflows/tests-linux-stable.yml +++ b/.github/workflows/tests-linux-stable.yml @@ -98,6 +98,37 @@ jobs: if: ${{ matrix.partition == '1/3' }} run: forklift cargo nextest run -p sp-api-test --features enable-staging-api --cargo-quiet + # some tests do not run with `try-runtime` feature enabled + # https://github.com/paritytech/polkadot-sdk/pull/4251#discussion_r1624282143 + # + # all_security_features_work and nonexistent_cache_dir are currently skipped + # becuase runners don't have the necessary permissions to run them + test-linux-stable-no-try-runtime: + needs: [preflight] + if: ${{ needs.preflight.outputs.changes_rust }} + runs-on: ${{ needs.preflight.outputs.RUNNER }} + timeout-minutes: 60 + container: + image: ${{ needs.preflight.outputs.IMAGE }} + env: + RUST_TOOLCHAIN: stable + # Enable debug assertions since we are running optimized builds for testing + # but still want to have debug assertions. + RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: script + run: | + forklift cargo nextest run --workspace \ + --locked \ + --release \ + --no-fail-fast \ + --cargo-quiet \ + --features experimental,riscv,ci-only-tests \ + -- --skip all_security_features_work \ + --skip nonexistent_cache_dir + confirm-required-jobs-passed: runs-on: ubuntu-latest name: All tests passed @@ -107,6 +138,7 @@ jobs: test-linux-stable-int, test-linux-stable-runtime-benchmarks, test-linux-stable, + test-linux-stable-no-try-runtime, ] if: always() && !cancelled() steps: From 7a65f6a46f2670569ddd4a489c76d3be6e03be47 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 8 Oct 2024 17:53:20 +0200 Subject: [PATCH 2/7] other filter --- .github/workflows/tests-linux-stable.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml index 1c929951fa0d7..09904acfc9d71 100644 --- a/.github/workflows/tests-linux-stable.yml +++ b/.github/workflows/tests-linux-stable.yml @@ -126,8 +126,7 @@ jobs: --no-fail-fast \ --cargo-quiet \ --features experimental,riscv,ci-only-tests \ - -- --skip all_security_features_work \ - --skip nonexistent_cache_dir + -E 'not test(=all_security_features_work) + not test(=nonexistent_cache_dir)' confirm-required-jobs-passed: runs-on: ubuntu-latest From 64693e1c71253e14e9259f28fcd120074b8e626f Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 8 Oct 2024 20:50:35 +0200 Subject: [PATCH 3/7] fix test names --- .github/workflows/tests-linux-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml index 09904acfc9d71..fca206a009709 100644 --- a/.github/workflows/tests-linux-stable.yml +++ b/.github/workflows/tests-linux-stable.yml @@ -126,7 +126,7 @@ jobs: --no-fail-fast \ --cargo-quiet \ --features experimental,riscv,ci-only-tests \ - -E 'not test(=all_security_features_work) + not test(=nonexistent_cache_dir)' + -E 'not test(=polkadot-node-core-pvf::it all_security_features_work) + not test(=polkadot-node-core-pvf::it nonexistent_cache_dir)' confirm-required-jobs-passed: runs-on: ubuntu-latest From dc29629c9f79e56ccba643109d76f43a1e3bd7e8 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 9 Oct 2024 11:44:23 +0200 Subject: [PATCH 4/7] rm workspace --- .github/workflows/tests-linux-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml index fca206a009709..df220c80f1be2 100644 --- a/.github/workflows/tests-linux-stable.yml +++ b/.github/workflows/tests-linux-stable.yml @@ -120,7 +120,7 @@ jobs: uses: actions/checkout@v4 - name: script run: | - forklift cargo nextest run --workspace \ + forklift cargo nextest run \ --locked \ --release \ --no-fail-fast \ From 81da521d0cc14f15407a07269f5abca45864b7f6 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 9 Oct 2024 11:50:31 +0200 Subject: [PATCH 5/7] try filter-expr --- .github/workflows/tests-linux-stable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml index df220c80f1be2..f78e24150985f 100644 --- a/.github/workflows/tests-linux-stable.yml +++ b/.github/workflows/tests-linux-stable.yml @@ -120,13 +120,13 @@ jobs: uses: actions/checkout@v4 - name: script run: | - forklift cargo nextest run \ + forklift cargo nextest run --workspace \ --locked \ --release \ --no-fail-fast \ --cargo-quiet \ --features experimental,riscv,ci-only-tests \ - -E 'not test(=polkadot-node-core-pvf::it all_security_features_work) + not test(=polkadot-node-core-pvf::it nonexistent_cache_dir)' + --filter-expr " !test(/all_security_features_work/) - test(/nonexistent_cache_dir/)" confirm-required-jobs-passed: runs-on: ubuntu-latest From b3ac552fa991cf88f20bdba94f6dacaf941ae679 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 9 Oct 2024 15:00:25 +0200 Subject: [PATCH 6/7] rm from gitlab, add partitions --- .github/workflows/tests-linux-stable.yml | 7 ++++++- .gitlab/pipeline/test.yml | 25 ------------------------ 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml index f78e24150985f..dd292d55e2018 100644 --- a/.github/workflows/tests-linux-stable.yml +++ b/.github/workflows/tests-linux-stable.yml @@ -110,6 +110,10 @@ jobs: timeout-minutes: 60 container: image: ${{ needs.preflight.outputs.IMAGE }} + strategy: + fail-fast: false + matrix: + partition: [1/2, 2/2] env: RUST_TOOLCHAIN: stable # Enable debug assertions since we are running optimized builds for testing @@ -126,7 +130,8 @@ jobs: --no-fail-fast \ --cargo-quiet \ --features experimental,riscv,ci-only-tests \ - --filter-expr " !test(/all_security_features_work/) - test(/nonexistent_cache_dir/)" + --filter-expr " !test(/all_security_features_work/) - test(/nonexistent_cache_dir/)" \ + --partition count:${{ matrix.partition }} \ confirm-required-jobs-passed: runs-on: ubuntu-latest diff --git a/.gitlab/pipeline/test.yml b/.gitlab/pipeline/test.yml index 0252620cd0f3e..00a0aa2c9771c 100644 --- a/.gitlab/pipeline/test.yml +++ b/.gitlab/pipeline/test.yml @@ -110,31 +110,6 @@ test-linux-stable-codecov: codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github; fi -# some tests do not run with `try-runtime` feature enabled -# https://github.com/paritytech/polkadot-sdk/pull/4251#discussion_r1624282143 -# Move to github after https://github.com/paritytech/ci_cd/issues/1056 is fixed -test-linux-stable-no-try-runtime: - stage: test - extends: - - .docker-env - - .common-refs - - .run-immediately - - .pipeline-stopper-artifacts - variables: - RUST_TOOLCHAIN: stable - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - script: - - > - time cargo nextest run \ - --workspace \ - --locked \ - --release \ - --no-fail-fast \ - --cargo-quiet \ - --features experimental,riscv,ci-only-tests - test-doc: stage: test extends: From 471e9e52c641454063af5da81509ec0a2901eb22 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 9 Oct 2024 15:20:36 +0200 Subject: [PATCH 7/7] rm gh cli install --- .github/actions/set-up-gh/action.yml | 38 +++++++++++----------------- .github/workflows/check-semver.yml | 9 +++---- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.github/actions/set-up-gh/action.yml b/.github/actions/set-up-gh/action.yml index fc16ce0b26334..4dc3af4a19f23 100644 --- a/.github/actions/set-up-gh/action.yml +++ b/.github/actions/set-up-gh/action.yml @@ -1,5 +1,5 @@ -name: 'install gh' -description: 'Install the gh cli in a debian based distro and switches to the PR branch.' +name: "install gh" +description: "Install the gh cli in a debian based distro and switches to the PR branch." inputs: pr-number: description: "Number of the PR" @@ -9,28 +9,20 @@ inputs: required: true outputs: branch: - description: 'Branch name for the PR' + description: "Branch name for the PR" value: ${{ steps.branch.outputs.branch }} runs: using: "composite" steps: - - name: Instal gh cli - shell: bash - # Here it would get the script from previous step - run: | - (type -p wget >/dev/null || (apt update && apt-get install wget -y)) - mkdir -p -m 755 /etc/apt/keyrings - wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null - chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null - apt update - apt install gh -y - git config --global --add safe.directory '*' - - run: gh pr checkout ${{ inputs.pr-number }} - shell: bash - env: - GITHUB_TOKEN: ${{ inputs.GH_TOKEN }} - - name: Export branch name - shell: bash - run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT" - id: branch + - name: Set up git + shell: bash + # Here it would get the script from previous step + run: git config --global --add safe.directory '*' + - run: gh pr checkout ${{ inputs.pr-number }} + shell: bash + env: + GITHUB_TOKEN: ${{ inputs.GH_TOKEN }} + - name: Export branch name + shell: bash + run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT" + id: branch diff --git a/.github/workflows/check-semver.yml b/.github/workflows/check-semver.yml index b5866e0ce4142..811ec4d5558f0 100644 --- a/.github/workflows/check-semver.yml +++ b/.github/workflows/check-semver.yml @@ -13,10 +13,13 @@ env: TOOLCHAIN: nightly-2024-06-01 jobs: + preflight: + uses: ./.github/workflows/reusable-preflight.yml check-semver: runs-on: ubuntu-latest + needs: [preflight] container: - image: docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408 + image: ${{ needs.preflight.outputs.IMAGE }} steps: - uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7 with: @@ -36,10 +39,6 @@ jobs: run: | echo "This is a backport into stable." - wget -q https://github.com/cli/cli/releases/download/v2.51.0/gh_2.51.0_linux_amd64.tar.gz -O gh.tar.gz && \ - tar -xzf gh.tar.gz && mv gh_2.51.0_linux_amd64/bin/gh /usr/local/bin/gh && rm gh.tar.gz - chmod +x /usr/local/bin/gh - cat > msg.txt <