Skip to content

Commit

Permalink
chore(ci): consolidate CI path filters (#194)
Browse files Browse the repository at this point in the history
This should hopefully be a bit more efficient, and lets us put
everything in one file.

Signed-off-by: Eliza Weisman <[email protected]>
  • Loading branch information
hawkw authored Jun 4, 2022
1 parent 0ba37ac commit 40e9291
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 257 deletions.
124 changes: 110 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,46 @@ env:
RUSTUP_MAX_RETRIES: 10
# don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short
# loom config
LOOM_MAX_PREEMPTIONS: 2
LOOM_LOG: "mycelium=trace,cordyceps=trace,maitake=trace,debug"

jobs:
is_enabled:
# continue-on-error: true # Uncomment once integration is finished
changed_paths:
continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
should_skip: ${{ steps.skip_check.outputs.should_skip }}git rb
paths_result: ${{ steps.skip_check.outputs.paths_result }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths: '["**/*.rs", "**/Cargo.toml", "Cargo.lock", ".github/workflows/ci_warnings.yml"]'
do_not_skip: '["workflow_dispatch", "push"]'
paths_ignore: '["**/README.md"]'
paths_filter: |
cordyceps:
paths:
- 'cordyceps/**/*.rs'
- 'cordyceps/Cargo.toml'
- '.github/workflows/ci.yml'
util:
paths:
- 'util/**/*.rs'
- 'util/Cargo.toml'
- '.github/workflows/ci.yml'
maitake:
paths:
- 'maitake/**/*.rs'
- 'maitake/Cargo.toml'
- '.github/workflows/ci.yml'
# run `cargo check` with the host target triple.
check-host:
name: cargo check (host)
needs: is_enabled
if: ${{ needs.is_enabled.outputs.should_skip != 'true' }}
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- name: install rust toolchain
Expand All @@ -59,8 +79,8 @@ jobs:

# check code style with `rustfmt`
rustfmt:
needs: is_enabled
if: ${{ needs.is_enabled.outputs.should_skip != 'true' }}
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- name: install rust toolchain
Expand All @@ -85,8 +105,8 @@ jobs:
test-host:
runs-on: ubuntu-latest
name: cargo test (host)
needs: is_enabled
if: ${{ needs.is_enabled.outputs.should_skip != 'true' }}
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true'
steps:
- name: install rust toolchain
run: rustup show
Expand All @@ -101,8 +121,8 @@ jobs:
build-x64:
name: build boot image (x86_64)
runs-on: ubuntu-latest
needs: is_enabled
if: ${{ needs.is_enabled.outputs.should_skip != 'true' }}
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true'
steps:
- name: install rust toolchain
run: rustup show
Expand All @@ -117,8 +137,8 @@ jobs:
test-x64:
name: cargo test (cross x64)
runs-on: ubuntu-latest
needs: is_enabled
if: ${{ needs.is_enabled.outputs.should_skip != 'true' }}
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true'
steps:
- name: install rust toolchain
run: rustup show
Expand All @@ -136,3 +156,79 @@ jobs:
with:
command: test-x64

### cordyceps ###

# run loom tests
cordyceps_loom:
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true' || !fromJSON(needs.changed_paths.outputs.paths_result).cordyceps.should_skip
runs-on: ubuntu-latest
name: Loom tests (cordyceps)
steps:
- name: install rust toolchain
run: rustup show
- uses: actions/checkout@v2
- name: run loom tests
run: cargo test --profile loom --lib -p cordyceps -- --nocapture --test-threads=1
env:
RUSTFLAGS: "--cfg loom"

# run miri tests
cordyceps_miri:
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true' || !fromJSON(needs.changed_paths.outputs.paths_result).cordyceps.should_skip
runs-on: ubuntu-latest
name: Miri tests (codyceps)
steps:
- name: install rust toolchain
run: rustup show
- uses: actions/checkout@v2
- name: run miri tests
run: ./bin/miri -p cordyceps

### maitake ###

# test with `--no-default-features`
maitake_no_default_features:
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true' || !fromJSON(needs.changed_paths.outputs.paths_result).maitake.should_skip
runs-on: ubuntu-latest
name: Tests (maitake, no-default-features)
steps:
- name: install rust toolchain
run: rustup show
- uses: actions/checkout@v2
- name: run tests
run: cargo test -p maitake --no-default-features

# run loom tests
maitake_loom:
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true' || !fromJSON(needs.changed_paths.outputs.paths_result).maitake.should_skip
runs-on: ubuntu-latest
name: Loom tests (maitake)
steps:
- name: install rust toolchain
run: rustup show
- uses: actions/checkout@v2
- name: run loom tests
run: cargo test --profile loom --lib -p maitake
env:
RUSTFLAGS: "--cfg loom"

### mycelium-util ###

# run loom tests
util_loom:
needs: changed_paths
if: needs.changed_paths.outputs.should_skip != 'true' || !fromJSON(needs.changed_paths.outputs.paths_result).util.should_skip
runs-on: ubuntu-latest
name: Loom tests (mycelium-util)
steps:
- name: install rust toolchain
run: rustup show
- uses: actions/checkout@v2
- name: run loom tests
run: cargo test --profile loom --lib -p mycelium-util
env:
RUSTFLAGS: "--cfg loom"
80 changes: 0 additions & 80 deletions .github/workflows/cordyceps.yml

This file was deleted.

69 changes: 0 additions & 69 deletions .github/workflows/loom-util.yml

This file was deleted.

Loading

0 comments on commit 40e9291

Please sign in to comment.