[DNM] gha tests #4396
This file contains 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
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel | |
name: tests linux stable | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
changes: | |
permissions: | |
pull-requests: read | |
uses: ./.github/workflows/check-changed-files.yml | |
set-image: | |
# GitHub Actions allows using 'env' in a container context. | |
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 | |
# This workaround sets the container image for each job using 'set-image' job output. | |
needs: changes | |
if: ${{ needs.changes.outputs.rust }} | |
runs-on: ubuntu-latest | |
outputs: | |
IMAGE: ${{ steps.set_image.outputs.IMAGE }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: set_image | |
run: cat .github/env >> $GITHUB_OUTPUT | |
test-linux-stable-int: | |
needs: [set-image, changes] | |
if: ${{ needs.changes.outputs.rust }} | |
runs-on: arc-runners-polkadot-sdk-beefy | |
timeout-minutes: 60 | |
container: | |
image: ${{ needs.set-image.outputs.IMAGE }} | |
env: | |
RUSTFLAGS: "-C debug-assertions -D warnings" | |
RUST_BACKTRACE: 1 | |
WASM_BUILD_NO_COLOR: 1 | |
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" | |
# Ensure we run the UI tests. | |
RUN_UI_TESTS: 1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: script | |
run: WASM_BUILD_NO_COLOR=1 time forklift cargo test -p staging-node-cli --release --locked -- --ignored | |
# https://github.com/paritytech/ci_cd/issues/864 | |
test-linux-stable-runtime-benchmarks: | |
needs: [set-image, changes] | |
if: ${{ needs.changes.outputs.rust }} | |
runs-on: arc-runners-polkadot-sdk-beefy | |
timeout-minutes: 60 | |
container: | |
image: ${{ needs.set-image.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: time forklift cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet | |
# | |
test-linux-stable: | |
needs: [set-image, changes] | |
runs-on: arc-runners-polkadot-sdk-beefy | |
timeout-minutes: 120 | |
container: | |
image: ${{ needs.set-image.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 -Cinstrument-coverage" | |
#LLVM_PROFILE_FILE: "target/coverage/cargo-test-${{ matrix.ci_node_index }}-%p-%m.profraw" | |
LLVM_PROFILE_FILE: "/__w/polkadot-sdk/polkadot-sdk/target/coverage/cargo-test-${{ matrix.ci_node_index }}-%p-%m.profraw" | |
strategy: | |
fail-fast: false | |
matrix: | |
ci_node_total: [5] | |
ci_node_index: [1,2,3,4,5] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: update forklift | |
run: curl -o .forklift/forklift -L https://github.com/paritytech/forklift/releases/download/0.13.1-alpha/forklift_0.13.1-alpha_linux_amd64 | |
- run: chmod +x .forklift/forklift && .forklift/forklift version | |
- run: rustup component add llvm-tools-preview | |
- run: cargo install cargo-llvm-cov | |
- run: mkdir -p target/coverage/result | |
- name: script | |
run: > | |
time cargo llvm-cov nextest | |
--no-report --release | |
--workspace | |
--locked --no-fail-fast | |
--features try-runtime,experimental,riscv,ci-only-tests | |
--filter-expr " | |
!test(/.*benchmark.*/) | |
- test(/recovers_from_only_chunks_if_pov_large::case_1/) | |
- test(/participation_requests_reprioritized_for_newly_included/) | |
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_1/) | |
- test(/rejects_missing_inherent_digest/) | |
- test(/availability_is_recovered_from_chunks_even_if_backing_group_supplied_if_chunks_only::case_1/) | |
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_2/) | |
- test(/all_security_features_work/) | |
- test(/nonexistent_cache_dir/) | |
- test(/recovers_from_only_chunks_if_pov_large::case_3/) | |
- test(/recovers_from_only_chunks_if_pov_large::case_2/) | |
- test(/authoring_blocks/) | |
- test(/rejects_missing_seals/) | |
- test(/generate_chain_spec/) | |
- test(/chain-spec-guide-runtime::chain_spec_builder_tests/) | |
" | |
--partition count:${{ matrix.ci_node_index }}/${{ matrix.ci_node_total }} | |
- run: ls -al target/coverage | |
- run: ls -al /__w/polkadot-sdk/polkadot-sdk/target | |
- run: ls -al /__w/polkadot-sdk/polkadot-sdk/target/llvm-cov-target | |
- name: generate report | |
run: cargo llvm-cov report --release --codecov --output-path coverage-${{ matrix.ci_node_index }}.info | |
- run: ls -al | |
- name: upload report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report-${{ matrix.ci_node_index }}.lcov | |
path: coverage-${{ matrix.ci_node_index }}.info | |
# | |
upload-reports: | |
needs: [test-linux-stable] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: reports | |
pattern: coverage-report-* | |
merge-multiple: true | |
- run: ls -al reports/ | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
directory: reports |