mirror of https://github.com/zcash/halo2.git
CI: Prepare feature flags in the internal composite action
This ensures that we only run CI on crate-external feature flags that we intend to be covered by our MSRV.
This commit is contained in:
parent
55abb2464a
commit
8dbc554f6c
|
@ -1,10 +1,26 @@
|
|||
name: 'Prepare Halo 2'
|
||||
description: 'Sets up the Rust toolchain'
|
||||
description: 'Sets up the Rust toolchain and prepares feature flags'
|
||||
inputs:
|
||||
toolchain:
|
||||
description: 'Rust toolchain to use (defaults to MSRV)'
|
||||
required: false
|
||||
default: 1.60.0
|
||||
beta-features:
|
||||
description: 'Include beta features'
|
||||
required: false
|
||||
default: false
|
||||
nightly-features:
|
||||
description: 'Include nightly features'
|
||||
required: false
|
||||
default: false
|
||||
test-dependencies:
|
||||
description: 'Include test dependencies'
|
||||
required: false
|
||||
default: true
|
||||
outputs:
|
||||
feature-flags:
|
||||
description: 'Feature flags'
|
||||
value: ${{ steps.prepare-flags.outputs.flags }}
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
|
@ -12,3 +28,26 @@ runs:
|
|||
with:
|
||||
toolchain: ${{ inputs.toolchain }}
|
||||
override: true
|
||||
- id: beta
|
||||
shell: bash
|
||||
run: echo "feature=beta" >> $GITHUB_OUTPUT
|
||||
if: inputs.beta-features == 'true'
|
||||
- id: nightly
|
||||
shell: bash
|
||||
run: echo "feature=nightly" >> $GITHUB_OUTPUT
|
||||
if: inputs.nightly-features == 'true'
|
||||
- id: test
|
||||
shell: bash
|
||||
run: echo "feature=test-dependencies" >> $GITHUB_OUTPUT
|
||||
if: inputs.test-dependencies == 'true'
|
||||
- id: prepare-flags
|
||||
shell: bash
|
||||
run: >
|
||||
echo "flags=--no-default-features --features '
|
||||
batch
|
||||
dev-graph
|
||||
gadget-traces
|
||||
${{ steps.beta.outputs.feature }}
|
||||
${{ steps.nightly.outputs.feature }}
|
||||
${{ steps.test.outputs.feature }}
|
||||
'" >> $GITHUB_OUTPUT
|
||||
|
|
|
@ -20,12 +20,18 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/prepare
|
||||
- id: prepare
|
||||
uses: ./.github/actions/prepare
|
||||
- name: Run tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --verbose --release --workspace --features batch,dev-graph,gadget-traces,test-dependencies ${{ matrix.extra_flags }}
|
||||
args: >
|
||||
--verbose
|
||||
--release
|
||||
--workspace
|
||||
${{ steps.prepare.outputs.feature-flags }}
|
||||
${{ matrix.extra_flags }}
|
||||
|
||||
build:
|
||||
name: Build target ${{ matrix.target }}
|
||||
|
@ -38,14 +44,20 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/prepare
|
||||
- id: prepare
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
nightly-features: true
|
||||
test-dependencies: false
|
||||
- name: Add target
|
||||
run: rustup target add ${{ matrix.target }}
|
||||
- name: cargo build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --features batch,dev-graph,gadget-traces,nightly --target ${{ matrix.target }}
|
||||
args: >
|
||||
${{ steps.prepare.outputs.feature-flags }}
|
||||
--target ${{ matrix.target }}
|
||||
|
||||
bitrot:
|
||||
name: Bitrot check
|
||||
|
@ -89,9 +101,11 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# Use stable for this to ensure that cargo-tarpaulin can be built.
|
||||
- uses: ./.github/actions/prepare
|
||||
- id: prepare
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
toolchain: stable
|
||||
nightly-features: true
|
||||
- name: Install cargo-tarpaulin
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
|
@ -101,7 +115,10 @@ jobs:
|
|||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: tarpaulin
|
||||
args: --features batch,dev-graph,gadget-traces,test-dependencies,nightly --timeout 600 --out Xml
|
||||
args: >
|
||||
${{ steps.prepare.outputs.feature-flags }}
|
||||
--timeout 600
|
||||
--out Xml
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3.1.1
|
||||
|
||||
|
|
|
@ -13,15 +13,19 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- id: prepare
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
toolchain: beta
|
||||
components: clippy
|
||||
override: true
|
||||
nightly-features: true
|
||||
- run: rustup component add clippy
|
||||
- name: Run Clippy (beta)
|
||||
uses: actions-rs/clippy-check@v1
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: Clippy (beta)
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --all-features --all-targets -- -W clippy::all
|
||||
args: >
|
||||
${{ steps.prepare.outputs.feature-flags }}
|
||||
--all-targets
|
||||
-- -W clippy::all
|
||||
|
|
|
@ -11,11 +11,17 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/prepare
|
||||
- id: prepare
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
nightly-features: true
|
||||
- run: rustup component add clippy
|
||||
- name: Run clippy
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
name: Clippy (MSRV)
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --all-features --all-targets -- -D warnings
|
||||
args: >
|
||||
${{ steps.prepare.outputs.feature-flags }}
|
||||
--all-targets
|
||||
-- -D warnings
|
||||
|
|
Loading…
Reference in New Issue