Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds paritytech/ci-linux:production (#536) #537

Merged
merged 3 commits into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 110 additions & 47 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,123 @@ on:
- main
- develop
- releases
workflow_dispatch:

env:
DOCKER_USER_OPTION: '$UID:$GID'

jobs:
check:
name: Check
substrate-check:
name: Check Benchmarks
runs-on:
- self-hosted
- linux
- x64
- sre
container:
image: paritytech/ci-linux:production
steps:
- name: Clean up
continue-on-error: true
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes
- uses: actions/checkout@v2
- name: Rustup show
run: |
rustup show
- uses: actions/checkout@v2
- run: |
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo check --all --benches
- name: Benchmark
- name: cargo check --all --benches
run: |
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo check --features=runtime-benchmarks --workspace --release --exclude integration-tests
- name: Picasso
SKIP_WASM_BUILD=1 cargo +nightly check --benches --all # checks all rust crates with default-features, tests, benchmarks

substrate-test-coverage:
name: Unit Tests (With Coverage)
runs-on:
- self-hosted
- linux
- x64
- sre
steps:
- name: Clean up
continue-on-error: true
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes
- uses: actions/checkout@v2
- name: Rustup show
run: |
/home/runner/.cargo/bin/rustup show
- uses: actions/checkout@v2
- name: Run Test (with coverage)
run: |
# integration tests can't be compiled with --feature=runtime-benchmarks
# TODO: https://github.com/ComposableFi/composable/issues/535
/home/runner/.cargo/bin/cargo install -f cargo-llvm-cov
/home/runner/.cargo/bin/rustup component add llvm-tools-preview --toolchain=nightly-2021-11-08
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-08 llvm-cov --workspace --locked --release --verbose --features=runtime-benchmarks --exclude=integration-tests --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: false

substrate-tests:
name: Unit Tests
runs-on:
- self-hosted
- linux
- x64
- sre
container:
image: paritytech/ci-linux:production
steps:
- name: Clean up
continue-on-error: true
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes
- uses: actions/checkout@v2
- name: Rustup show
run: |
rustup show
- uses: actions/checkout@v2
- name: Run Test (with coverage)
run: |
/home/runner/.cargo/bin/cargo build --release -p picasso-runtime
SKIP_WASM_BUILD=1 cargo test --workspace --locked --release --verbose --features=runtime-benchmarks --exclude=integration-tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: false

linters:
name: Linters
runs-on:
- self-hosted
- linux
- x64
- sre
container:
image: paritytech/ci-linux:production
steps:
- uses: actions/checkout@v2
- run: |
/home/runner/.cargo/bin/rustup install nightly-2021-11-29
/home/runner/.cargo/bin/rustup target add --toolchain=nightly-2021-11-29 wasm32-unknown-unknown
/home/runner/.cargo/bin/rustup show
/home/runner/.cargo/bin/rustup override unset
/home/runner/.cargo/bin/rustup show
- name: Rustup show
run: |
rustup show
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Cargo fmt
run: |
/home/runner/.cargo/bin/cargo +nightly-2021-11-29 fmt -- --check
cargo +nightly fmt --all -- --check

- name: Hadolint
env:
HADOLINT_VERSION: v2.8.0
continue-on-error: true # this step is such a pita
run: |
curl -L -o hadolint "https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-Linux-x86_64"
chmod +x hadolint
Expand All @@ -61,11 +134,27 @@ jobs:
echo "=== $file ==="
./hadolint --config .hadolint.yaml $file || total_exit_code=$?
echo ""
done < <(find . -name "Dockerfile")
done << (find . -name "Dockerfile")
exit $total_exit_code

- name: Remark
continue-on-error: true # this step is such a pita
run: |
npm install yarn
./node_modules/.bin/yarn add remark-cli \
remark-lint-mdash-style \
https://github.com/typeable/remark-validate-links#anchors \
remark-preset-lint-recommended \
remark-lint-no-dead-urls

total_exit_code=0
while IFS= read -r file; do
./node_modules/.bin/remark -f $file || total_exit_code=$?
done << (find . -name "*.md" -not -path "*/node_modules/*" -not -path "./.github/*")
exit $total_exit_code
- name: Cargo clippy
run: |
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 clippy -- -D warnings
SKIP_WASM_BUILD=1 env -u RUSTFLAGS cargo +nightly clippy --all-targets
- name: Cargo udeps
env:
UDEPS_VERSION: v0.1.24
Expand All @@ -74,33 +163,7 @@ jobs:
tar xzf "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
cp "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu/cargo-udeps" ~/.cargo/bin/
rm -r "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu.tar.gz" "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu"
/home/runner/.cargo/bin/cargo +nightly-2021-11-29 udeps --version
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 udeps --workspace --all-features
cargo udeps --version
SKIP_WASM_BUILD=1 cargo udeps --workspace --all-features
continue-on-error: true # Often this turns gives false positives, due to the different ways that Substrate uses features.
test:
name: Unit Test
runs-on:
- self-hosted
- linux
- x64
- sre
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: |
/home/runner/.cargo/bin/rustup component add llvm-tools-preview
- name: Install cargo-llvm-cov
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: Run Test (with coverage)
run: |
/home/runner/.cargo/bin/rustup install nightly-2021-11-29
/home/runner/.cargo/bin/rustup component add llvm-tools-preview --toolchain=nightly-2021-11-29
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: false

22 changes: 0 additions & 22 deletions .github/workflows/runtime-check.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ scripts/polkadot-launch/*.log

target
.env

node_modules/
**/yarn-error.log
**/.yarn/
rust-toolchain.toml