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

ci: staking-miner-playground check only if changed #848

Merged
merged 4 commits into from
Jun 13, 2024
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
21 changes: 0 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,6 @@ jobs:
${{ env.RUST_INFO }}
cargo hack check --workspace --each-feature --all-targets

check-staking-miner-playground:
name: Check staking-miner-playground
runs-on: ubuntu-latest
needs: [set-image]
container: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}

- name: Check staking-miner-playground
run: |
${{ env.RUST_INFO }}
cargo check --manifest-path staking-miner-playground/Cargo.toml

test:
name: Run tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -181,7 +162,6 @@ jobs:
check-clippy,
check-docs,
check-cargo-hack,
check-staking-miner-playground,
test,
build]
steps:
Expand Down Expand Up @@ -221,7 +201,6 @@ jobs:
check-clippy,
check-docs,
check-cargo-hack,
check-staking-miner-playground,
test,
build]
steps:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/staking-miner-playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Polkadot Staking Miner Playground CI

on:
pull_request:
branches:
- main
paths:
- 'staking-miner-playground/**'

env:
IMAGE: paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408
IMAGE_NAME: paritytech/polkadot-staking-miner
RUST_INFO: rustup show && cargo --version && rustup +nightly show && cargo +nightly --version

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
set-image:
# GitHub Actions does not allow using 'env' in a container context.
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- id: set_image
run: echo "IMAGE=${{ env.IMAGE }}" >> $GITHUB_OUTPUT

check:
name: Check staking-miner-playground
runs-on: ubuntu-latest
needs: [set-image]
container: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}

- name: Check staking-miner-playground
run: |
${{ env.RUST_INFO }}
cargo check --manifest-path staking-miner-playground/Cargo.toml
26 changes: 13 additions & 13 deletions staking-miner-playground/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading