feat: add AppError type for application level errors #1183
Workflow file for this run
This file contains hidden or 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
| name: main | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| testing: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_MSRV, RUST_NIGHTLY | |
| cargo-tools: CARGO_NEXTEST_VERSION, CARGO_HACK_VERSION, JUST_VERSION | |
| # execute | |
| - name: Build | |
| run: cargo hack build --each-feature --workspace --verbose --locked --color always | |
| - name: Tests | |
| if: success() || failure() | |
| run: cargo nextest run --verbose --workspace --all-features | |
| - name: Docs | |
| if: success() || failure() | |
| env: | |
| RUSTDOCFLAGS: "--cfg docsrs -D warnings" | |
| run: cargo +${{ env.RUST_NIGHTLY }} doc --no-deps --verbose --workspace --all-features | |
| - name: Doc Tests | |
| if: success() || failure() | |
| run: cargo test --doc --verbose --workspace --all-features | |
| - name: Examples | |
| run: just examples | |
| static-analysis: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_LATEST | |
| rust-components: clippy, rustfmt | |
| cargo-tools: CARGO_DOC2README_VERSION, CARGO_WORKSPACES_VERSION, CARGO_ENSURE_NO_DEFAULT_FEATURES_VERSION, CARGO_ENSURE_NO_CYCLIC_DEPS_VERSION, CARGO_DENY_VERSION, CARGO_SORT_VERSION | |
| # execute | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| - name: Source Format | |
| if: success() || failure() | |
| run: cargo fmt -- --check | |
| - name: Cargo.toml Format | |
| if: success() || failure() | |
| run: cargo sort --check --grouped --workspace | |
| - name: Readmes | |
| if: success() || failure() | |
| run: cargo workspaces exec --ignore-private cargo doc2readme --check --lib --template ../README.j2 | |
| - name: Default Features | |
| if: success() || failure() | |
| run: cargo ensure-no-default-features | |
| - name: Cyclic Dependencies | |
| if: success() || failure() | |
| run: cargo ensure-no-cyclic-deps | |
| - name: Dependency Validation | |
| if: success() || failure() | |
| run: cargo deny --all-features --workspace --color always check all | |
| spell-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| rust-toolchain: RUST_LATEST | |
| cargo-tools: CARGO_SPELLCHECK_VERSION, JUST_VERSION | |
| - name: Check Spelling | |
| run: just spellcheck | |
| semver: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_LATEST | |
| cargo-tools: CARGO_SEMVER_CHECKS_VERSION | |
| # execute | |
| - name: Semver Compatibility | |
| id: semver | |
| continue-on-error: true | |
| run: | | |
| set -o pipefail | |
| cargo semver-checks --all-features --workspace --color never --baseline-rev origin/${{ github.base_ref }} 2>&1 | tee semver-output.txt | |
| # report | |
| - name: Prepare Semver Comment | |
| if: steps.semver.outcome == 'failure' | |
| run: | | |
| echo "## ⚠️ Breaking Changes Detected" > semver-comment.txt | |
| echo "" >> semver-comment.txt | |
| echo '```' >> semver-comment.txt | |
| grep -v "^ *Cloning " semver-output.txt | grep -v "^ *Building " | grep -v "^ *Built \[" | grep -v "^ *Parsing " | grep -v "^ *Parsed \[" | grep -v "^ *Checking" | grep -v "^ *Checked \[" | grep -v "^ *Finished \[" | grep -v "^ *Summary " >> semver-comment.txt | |
| echo '```' >> semver-comment.txt | |
| echo "" >> semver-comment.txt | |
| echo "If the breaking changes are intentional then everything is fine - this message is merely informative." >> semver-comment.txt | |
| echo "" >> semver-comment.txt | |
| echo "Remember to apply a version number bump with the correct severity when publishing a version with breaking changes (\`1.x.x -> 2.x.x\` or \`0.1.x -> 0.2.x\`)." >> semver-comment.txt | |
| - name: Post Semver Failure Comment | |
| if: steps.semver.outcome == 'failure' | |
| uses: marocchino/[email protected] | |
| with: | |
| header: semver-check | |
| path: semver-comment.txt | |
| - name: Remove Semver Comment on Success | |
| if: steps.semver.outcome == 'success' | |
| uses: marocchino/[email protected] | |
| with: | |
| header: semver-check | |
| delete: true | |
| extended-analysis: | |
| if: github.event_name == 'pull_request' | |
| needs: [testing, static-analysis] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_NIGHTLY | |
| rust-components: miri | |
| cargo-tools: CARGO_UDEPS_VERSION, CARGO_CAREFUL_VERSION, CARGO_NEXTEST_VERSION | |
| # execute | |
| - name: Udeps | |
| run: cargo +${{ env.RUST_NIGHTLY }} udeps --all-features --workspace --color always | |
| - name: Careful | |
| if: success() || failure() | |
| run: cargo +${{ env.RUST_NIGHTLY }} careful nextest run --all-features --workspace --color always --target ${{ runner.os == 'Linux' && 'x86_64-unknown-linux-gnu' || 'x86_64-pc-windows-msvc' }} | |
| - name: Miri | |
| if: success() || failure() | |
| run: cargo +${{ env.RUST_NIGHTLY }} miri test --all-features --workspace | |
| mutation-testing: | |
| if: github.event_name == 'pull_request' | |
| needs: [testing] | |
| runs-on: ubuntu-latest | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| enable-wild-linker: true | |
| rust-toolchain: RUST_NIGHTLY | |
| cargo-tools: CARGO_MUTANTS_VERSION | |
| # execute | |
| - name: Generate PR Diff | |
| run: git diff origin/main...HEAD >diff.txt | |
| - name: Mutate Diff | |
| timeout-minutes: 45 | |
| run: cargo +${{ env.RUST_NIGHTLY }} -Zscript scripts/mutants.rs --in-place --in-diff diff.txt | |
| coverage: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_NIGHTLY | |
| rust-components: llvm-tools-preview | |
| cargo-tools: CARGO_LLVM_COV_VERSION | |
| # execute | |
| - name: Generate Coverage (all-features) | |
| run: cargo +${{ env.RUST_NIGHTLY }} llvm-cov --all-features --workspace --lcov --output-path lcov-all.info | |
| - name: Generate Coverage (no-default-features) | |
| run: cargo +${{ env.RUST_NIGHTLY }} llvm-cov --no-default-features --workspace --lcov --output-path lcov-no-def.info | |
| - name: Upload Coverage to Codecov | |
| uses: codecov/[email protected] | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: lcov-all.info,lcov-no-def.info | |
| fail_ci_if_error: true | |
| pr-title: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Check PR Title | |
| uses: amannn/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| build | |
| chore | |
| ci | |
| doc | |
| docs | |
| feat | |
| fix | |
| misc | |
| miscellaneous | |
| perf | |
| refactor | |
| style | |
| task | |
| test | |
| license-headers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 1 | |
| - name: Check License Headers | |
| uses: viperproject/[email protected] | |
| with: | |
| path: . | |
| config: .github/license-check/config.json | |
| strict: true | |
| external-type-exposure: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_NIGHTLY_EXTERNAL_TYPES | |
| cargo-tools: CARGO_CHECK_EXTERNAL_TYPES_VERSION | |
| # execute | |
| - name: Check External Type Exposure | |
| run: cargo +${{ env.RUST_NIGHTLY_EXTERNAL_TYPES }} -Zscript scripts/check-external-types.rs ${{ env.RUST_NIGHTLY_EXTERNAL_TYPES }} |