Feature Powerset #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check to build Roadster with all combinations (powerset) of features. Because we have a bunch of features, the | |
# powerset of all features is quite large, meaning we need to run a large number of iterations of the tests. To | |
# conserve CI usage, as well as mimimize CI time needed on PRs, we'll only run checks against the feature powerset | |
# twice a week, and only if a commit was merged in the past 5 days. | |
name: Feature Powerset | |
on: | |
schedule: | |
# Run once a week on Friday at 11PM UTC (Friday 4PM PST) | |
- cron: '0 23 * * 5' | |
# Run once a week on Monday at 11PM UTC (Monday 4PM PST) | |
- cron: '0 23 * * 1' | |
workflow_dispatch: | |
pull_request: | |
branches: [ main ] | |
types: [ labeled ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
# https://stackoverflow.com/questions/63014786/how-to-schedule-a-github-actions-nightly-build-but-run-it-only-when-there-where | |
check_trigger: | |
runs-on: ubuntu-latest | |
name: Check trigger | |
outputs: | |
should_run1: ${{ steps.schedule_trigger.outputs.should_run }} | |
should_run2: ${{ steps.label_trigger.outputs.should_run }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: print latest_commit | |
run: echo ${{ github.sha }} | |
- id: schedule_trigger | |
continue-on-error: true | |
name: Check latest commit is less than 5 days ago | |
if: ${{ github.event_name == 'schedule' }} | |
run: test $(git rev-list --after="5 days" ${{ github.sha }}) && echo "should_run=true" >> "$GITHUB_OUTPUT" | |
- id: label_trigger | |
continue-on-error: true | |
name: Check that the powerset_check label was added | |
if: ${{ github.event_name == 'pull_request' && github.event.label.name == 'powerset_check' }} | |
run: echo "should_run=true" >> "$GITHUB_OUTPUT" | |
powerset_test: | |
name: Powerset Tests | |
needs: check_trigger | |
if: ${{ needs.check_trigger.outputs.should_run1 == 'true' || needs.check_trigger.outputs.should_run2 == 'true' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: taiki-e/install-action@nextest | |
# protoc is needed to build examples that have grpc enabled | |
- uses: taiki-e/install-action@protoc | |
- name: Test | |
run: cargo hack nextest run --no-fail-fast --feature-powerset --depth 3 --skip default --group-features jwt-ietf,jwt --group-features jwt-openid,jwt --group-features open-api,http --clean-per-run --log-group github-actions --exclude-no-default-features --exclude-all-features | |
- name: Check disk usage | |
run: df -h | |
powerset_doc_test: | |
name: Powerset Doc tests | |
needs: check_trigger | |
if: ${{ needs.check_trigger.outputs.should_run1 == 'true' || needs.check_trigger.outputs.should_run2 == 'true' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@cargo-hack | |
# protoc is needed to build examples that have grpc enabled | |
- uses: taiki-e/install-action@protoc | |
- name: Doc test | |
run: cargo hack test --doc --no-fail-fast --feature-powerset --depth 3 --skip default --group-features jwt-ietf,jwt --group-features jwt-openid,jwt --group-features open-api,http --clean-per-run --log-group github-actions --exclude-no-default-features --exclude-all-features | |
powerset_check: | |
name: Powerset Check | |
needs: check_trigger | |
if: ${{ needs.check_trigger.outputs.should_run1 == 'true' || needs.check_trigger.outputs.should_run2 == 'true' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@cargo-hack | |
# protoc is needed to build examples that have grpc enabled | |
- uses: taiki-e/install-action@protoc | |
- name: Check | |
run: cargo hack check --feature-powerset --depth 3 --no-dev-deps --skip default --group-features jwt-ietf,jwt --group-features jwt-openid,jwt --group-features open-api,http --clean-per-run --log-group github-actions --exclude-no-default-features --exclude-all-features | |
powerset_clippy: | |
name: Powerset Clippy | |
needs: check_trigger | |
if: ${{ needs.check_trigger.outputs.should_run1 == 'true' || needs.check_trigger.outputs.should_run2 == 'true' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@cargo-hack | |
# protoc is needed to build examples that have grpc enabled | |
- uses: taiki-e/install-action@protoc | |
- name: Clippy | |
run: cargo hack clippy --all-targets --feature-powerset --depth 3 --skip default --group-features jwt-ietf,jwt --group-features jwt-openid,jwt --group-features open-api,http --clean-per-run --log-group github-actions --exclude-no-default-features --exclude-all-features -- -D warnings |