diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 566bfd1..4282beb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,65 +4,99 @@ on: push: branches: - master - tags-ignore: '*' + tags-ignore: + - "*" pull_request: branches: - - '*' - tags-ignore: '*' + - "*" schedule: # * is a special character in YAML so you have to quote this string - - cron: '13 3 * * *' + - cron: "13 3 * * *" -name: CI +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + +name: ๐Ÿฆ€ Rust ๐Ÿฆ€ jobs: rustfmt: - name: โ˜ข๏ธ Formatting โ˜ข๏ธ + name: ๐Ÿ“Œ Formatting ๐Ÿ“Œ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt - - run: cargo fmt --all -- --check - lints: - name: ๐Ÿ•ณ๏ธ Lints ๐Ÿ•ณ๏ธ + - name: โœ… Checkout โœ… + uses: actions/checkout@v4 + - name: โญ• Rustfmt Check โญ• + run: cargo fmt --all -- --check + lints-linux: + name: ๐Ÿ•ณ๏ธ Lints Linux ๐Ÿ•ณ๏ธ needs: rustfmt runs-on: ${{ matrix.os }} strategy: matrix: include: - - os: ubuntu-latest - rust: "1.62.0" - - os: ubuntu-latest - rust: stable - - os: ubuntu-latest - rust: beta - os: ubuntu-latest rust: nightly + steps: + - name: โœ… Checkout โœ… + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ + run: | + rustup toolchain remove ${{ matrix.rust }} + rustup toolchain install ${{ matrix.rust }} --profile default + rustup default ${{ matrix.rust }} + - name: ๐Ÿ“Ž Clippy ๐Ÿ“Ž + run: | + cargo update + cargo clippy --all-targets --all-features -- -D warnings + lints-macos: + name: ๐Ÿ•ณ๏ธ Lints MacOS ๐Ÿ•ณ๏ธ + needs: rustfmt + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: - os: macos-latest - rust: stable + rust: nightly + steps: + - name: โœ… Checkout โœ… + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ + run: | + rustup toolchain remove ${{ matrix.rust }} + rustup toolchain install ${{ matrix.rust }} --profile default --no-self-update + rustup default ${{ matrix.rust }} + - name: ๐Ÿ“Ž Clippy ๐Ÿ“Ž + run: | + cargo update + cargo clippy --all-targets --all-features -- -D warnings + lints-windows: + name: ๐Ÿ•ณ๏ธ Lints Windows ๐Ÿ•ณ๏ธ + needs: rustfmt + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: - os: windows-latest - rust: stable + rust: nightly steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - components: clippy - - run: cargo clippy --all -- -D warnings + - name: โœ… Checkout โœ… + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ + run: | + rustup toolchain remove ${{ matrix.rust }} + rustup toolchain install ${{ matrix.rust }} --profile default --no-self-update + rustup default ${{ matrix.rust }} + - name: ๐Ÿ“Ž Clippy ๐Ÿ“Ž + run: | + cargo update + cargo clippy --all-targets --all-features -- -D warnings test-linux: name: ๐Ÿงช Linux ๐Ÿงช - needs: lints + needs: lints-linux runs-on: ${{ matrix.os }} strategy: matrix: @@ -92,49 +126,32 @@ jobs: rust: nightly target: x86_64-unknown-linux-gnu steps: - - name: โœ”๏ธ Checkout โœ”๏ธ - uses: actions/checkout@v2 - with: - submodules: recursive - - name: ๐Ÿ’ต Cache ๐Ÿ’ต - uses: actions/cache@v2 - with: - path: | - ~/.cargo/bin/cargo-tarpaulin* - ~/.cargo/bin/cargo-*-all-features* - key: ${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ - with: - profile: minimal - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} - override: true + - name: โœ… Checkout โœ… + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ + run: | + rustup toolchain remove ${{ matrix.rust }} + rustup toolchain install ${{ matrix.rust }} --profile default --no-self-update + rustup default ${{ matrix.rust }} + - name: ๐Ÿ’พ Install (cargo-binstall) ๐Ÿ’พ + uses: cargo-bins/cargo-binstall@main - name: ๐Ÿ’พ Install (cargo-tarpaulin) ๐Ÿ’พ - uses: actions-rs/install@v0.1 - with: - crate: cargo-tarpaulin - version: latest - use-tool-cache: true continue-on-error: true - - name: ๐Ÿ’พ Install (cargo-all-features) ๐Ÿ’พ - uses: actions-rs/install@v0.1 - with: - crate: cargo-all-features - version: latest - use-tool-cache: true + run: cargo binstall --no-confirm --no-symlinks cargo-tarpaulin + - name: ๐Ÿ’พ Install (all-features) ๐Ÿ’พ continue-on-error: true + run: cargo binstall --no-confirm --no-symlinks cargo-all-features - name: ๐Ÿงช Test ๐Ÿงช run: cargo test-all-features - name: ๐Ÿ™Š Code Coverage ๐Ÿ™Š run: cargo tarpaulin --out Xml - name: ๐Ÿ™Š Upload Code Coverage ๐Ÿ™Š - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: files: ./cobertura.xml test-macos: name: ๐Ÿงช MacOS ๐Ÿงช - needs: lints + needs: lints-macos runs-on: ${{ matrix.os }} strategy: matrix: @@ -164,35 +181,23 @@ jobs: rust: nightly target: x86_64-apple-ios steps: - - name: โœ”๏ธ Checkout โœ”๏ธ - uses: actions/checkout@v2 - with: - submodules: recursive - - name: ๐Ÿ’ต Cache ๐Ÿ’ต - uses: actions/cache@v2 - with: - path: | - ~/.cargo/bin/cargo-*-all-features* - key: ${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ - with: - profile: minimal - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} - override: true - - name: ๐Ÿ’พ Install (cargo-all-features) ๐Ÿ’พ - uses: actions-rs/install@v0.1 - with: - crate: cargo-all-features - version: latest - use-tool-cache: true + - name: โœ… Checkout โœ… + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ + run: | + rustup toolchain remove ${{ matrix.rust }} + rustup toolchain install ${{ matrix.rust }} --profile default --no-self-update + rustup default ${{ matrix.rust }} + - name: ๐Ÿ’พ Install (cargo-binstall) ๐Ÿ’พ + uses: cargo-bins/cargo-binstall@main + - name: ๐Ÿ’พ Install (all-features) ๐Ÿ’พ continue-on-error: true + run: cargo binstall --no-confirm --no-symlinks cargo-all-features - name: ๐Ÿงช Test ๐Ÿงช run: cargo test-all-features test-windows: name: ๐Ÿงช Windows ๐Ÿงช - needs: lints + needs: lints-windows runs-on: ${{ matrix.os }} strategy: matrix: @@ -246,29 +251,17 @@ jobs: rust: nightly-gnu target: x86_64-pc-windows-gnu steps: - - name: โœ”๏ธ Checkout โœ”๏ธ - uses: actions/checkout@v2 - with: - submodules: recursive - - name: ๐Ÿ’ต Cache ๐Ÿ’ต - uses: actions/cache@v2 - with: - path: | - ~/.cargo/bin/cargo-*-all-features* - key: ${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }} - - uses: actions-rs/toolchain@v1 - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ - with: - profile: minimal - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} - override: true - - name: ๐Ÿ’พ Install (cargo-all-features) ๐Ÿ’พ - uses: actions-rs/install@v0.1 - with: - crate: cargo-all-features - version: latest - use-tool-cache: true + - name: โœ… Checkout โœ… + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Toolchain ๐Ÿงฐ + run: | + rustup toolchain remove ${{ matrix.rust }} + rustup toolchain install ${{ matrix.rust }} --profile default --no-self-update + rustup default ${{ matrix.rust }} + - name: ๐Ÿ’พ Install (cargo-binstall) ๐Ÿ’พ + uses: cargo-bins/cargo-binstall@main + - name: ๐Ÿ’พ Install (all-features) ๐Ÿ’พ continue-on-error: true + run: cargo binstall --no-confirm --no-symlinks cargo-all-features - name: ๐Ÿงช Test ๐Ÿงช run: cargo test-all-features