diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ci.yml | 73 | ||||
| -rw-r--r-- | .github/workflows/release-plz.yml | 53 | 
2 files changed, 97 insertions, 29 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a478db..8353c96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@  name: Rust CI checks  on:    push: +  pull_request: + +env: +  CARGO_TERM_COLOR: always +# Make sure CI fails on all warnings, including Clippy lints +  RUSTFLAGS: "-Dwarnings"  jobs:    lint: @@ -8,58 +14,67 @@ jobs:      runs-on: ubuntu-latest      strategy:        matrix: -        rust: -          - stable -          - 1.36.0 +        feature: +          - actix4,warp,axum +          - actix3      steps:        - uses: actions/checkout@v2        - name: Install Rust stable toolchain -        uses: actions-rs/toolchain@v1 +        uses: dtolnay/rust-toolchain@master          with: -          profile: minimal            toolchain: stable -          override: true            components: rustfmt, clippy -      - name: Check Rust formatting -        uses: actions-rs/cargo@v1 -        with: -          command: fmt -          args: --all -- --check -      - name: Check clippy -        uses: actions-rs/clippy-check@v1 -        with: -          token: ${{ secrets.GITHUB_TOKEN }} -          args: --all-targets -- -D warnings +      - name: Run formatting +        run: cargo fmt --all --check +      - name: Run Clippy +        run: cargo clippy --all-targets -F "${{ matrix.feature }}"    test:      name: Run tests      runs-on: ubuntu-latest      strategy:        matrix: +        # NOTE: this crate's MSRC if 1.63 +        # However, many of the web frameworks that  +        # this provides support for have greater/missing MSRVs. +        # We attempt to test the MSRV here if it is known.          rust:            - stable -          - 1.36.0 +          - 1.63.0          feature:            - ""            - actix4            - actix3 -          - actix2            - warp            - axum + +        # test frameworks for specific MSRVs (where known) +        include: +        # axum 0.8 has a MSRV of 1.75.0 +        - rust: 1.75.0 +          feature: axum + +        # exclude frameworks that have a different/unknown MSRV +        exclude: +        - rust: 1.63.0 +          feature: axum +        # actix does not seem to actually adhere +        # to its MSRV -- it states 1.75 but has a dependency `zerofrom` +        # that requires Rust 1.81. We'll punt on testing it +        - rust: 1.63.0 +          feature: actix4 +        - rust: 1.63.0 +          feature: actix3 +        # warp does not list an MSRV +        # see: https://github.com/seanmonstar/warp/issues/1077 +        - rust: 1.63.0 +          feature: warp      steps: -      - uses: actions/checkout@v2 -      - uses: actions/cache@v2 -        with: -          path: | -            ~/.cargo/registry -            ~/.cargo/git -            target -          key: ${{ runner.os }}-cargo-test-${{ hashFiles('Cargo.toml') }} +      - uses: actions/checkout@v4        - name: Install Rust stable toolchain -        uses: actions-rs/toolchain@v1 +        uses: dtolnay/rust-toolchain@stable          with: -          profile: minimal -          toolchain: stable +          toolchain: ${{ matrix.rust }}        - name: Run test ${{ matrix.feature }}          run: |            cargo test --all-targets --features "${{ matrix.feature }}" diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 0000000..6ee6e4a --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,53 @@ +name: Release-plz + +on: +  push: +    branches: +      - main + +jobs: +  release-plz-release: +    name: Release-plz release +    runs-on: ubuntu-latest +    permissions: +      contents: write +    steps: +      - name: Checkout repository +        uses: actions/checkout@v4 +        with: +          fetch-depth: 0 +          token: ${{ secrets.RELEASE_PLZ_TOKEN }} +      - name: Install Rust toolchain +        uses: dtolnay/rust-toolchain@stable +      - name: Run release-plz +        uses: release-plz/action@v0.5 +        with: +          command: release +        env: +          GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} +          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + +  release-plz-pr: +    name: Release-plz PR +    runs-on: ubuntu-latest +    permissions: +      pull-requests: write +      contents: write +    concurrency: +      group: release-plz-${{ github.ref }} +      cancel-in-progress: false +    steps: +      - name: Checkout repository +        uses: actions/checkout@v4 +        with: +          fetch-depth: 0 +          token: ${{ secrets.RELEASE_PLZ_TOKEN }} +      - name: Install Rust toolchain +        uses: dtolnay/rust-toolchain@stable +      - name: Run release-plz +        uses: release-plz/action@v0.5 +        with: +          command: release-pr +        env: +          GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} +          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}  | 
