Skip to content

Commit

Permalink
ci: staking-miner-playground check only if changed (#848)
Browse files Browse the repository at this point in the history
* ci: staking-miner-playground check only changed

* fix ci steps

* update staking-miner-playground deps

* Update staking-miner-playground/Cargo.lock
  • Loading branch information
niklasad1 authored Jun 13, 2024
1 parent eac2a66 commit 66f4ce9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 34 deletions.
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.

0 comments on commit 66f4ce9

Please sign in to comment.