From 0c91c0dc0d864ddbb4c3492a424a0baad853c56b Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Tue, 5 Dec 2023 09:40:53 +0000 Subject: [PATCH] ci(dtt): :art: enhanced ci jobs --- .github/workflows/audit.yml | 4 +- .github/workflows/check.yml | 4 +- .github/workflows/document.yml | 6 +- .github/workflows/lint.yml | 4 +- .github/workflows/release.yml | 213 +++++++++++++++------------------ .github/workflows/test.yml | 4 +- 6 files changed, 110 insertions(+), 125 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 822bd5e..1e5cf4d 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -15,9 +15,9 @@ jobs: name: Audit dependencies runs-on: ubuntu-latest steps: - - uses: hecrj/setup-rust-action@v1 + - uses: hecrj/setup-rust-action@v2 - name: Install cargo-audit run: cargo install cargo-audit - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Audit dependencies run: cargo audit diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2d29ad7..4436757 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -15,9 +15,9 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: hecrj/setup-rust-action@v1 + - uses: hecrj/setup-rust-action@v2 with: components: clippy - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Check lints run: cargo check --all-targets --workspace --all-features diff --git a/.github/workflows/document.yml b/.github/workflows/document.yml index d0d7bdb..03b3d50 100644 --- a/.github/workflows/document.yml +++ b/.github/workflows/document.yml @@ -16,11 +16,11 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }} steps: - - uses: hecrj/setup-rust-action@v1 + - uses: hecrj/setup-rust-action@v2 with: rust-version: nightly - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Update libssl run: | @@ -46,7 +46,7 @@ jobs: run: echo 'doc.dttlib.one' > ./target/doc/CNAME - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3.9.3 + uses: peaceiris/actions-gh-pages@v3 with: cname: true commit_message: Deploy documentation at ${{ github.sha }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c829bb5..c8fa558 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,9 +15,9 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: hecrj/setup-rust-action@v1 + - uses: hecrj/setup-rust-action@v2 with: components: clippy - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Check lints run: cargo clippy --workspace --all-features --all-targets --no-deps -- -D warnings diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5d0bc7..cdf1ba3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,10 @@ name: ๐Ÿงช Release on: [push, pull_request] +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: # Build the project for all the targets and generate artifacts. build: @@ -44,113 +48,92 @@ jobs: - arm-unknown-linux-gnueabi # ARMv6 Linux (kernel 3.2, glibc 2.17) - arm-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) - armv7-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) - - mips-unknown-linux-gnu # MIPS Linux (kernel 3.2, glibc 2.17) - - mips64-unknown-linux-gnuabi64 # MIPS64 Linux (kernel 3.2, glibc 2.17) - - mips64el-unknown-linux-gnuabi64 # MIPS64el Linux (kernel 3.2, glibc 2.17) - - mipsel-unknown-linux-gnu # MIPSel Linux (kernel 3.2, glibc 2.17) - powerpc-unknown-linux-gnu # PowerPC Linux (kernel 3.2, glibc 2.17) - powerpc64-unknown-linux-gnu # PowerPC64 Linux (kernel 3.2, glibc 2.17) - powerpc64le-unknown-linux-gnu # PowerPC64le Linux (kernel 3.2, glibc 2.17) - riscv64gc-unknown-linux-gnu # RISC-V Linux (kernel 3.2, glibc 2.17) - s390x-unknown-linux-gnu # s390x Linux (kernel 3.2, glibc 2.17) - x86_64-unknown-freebsd # 64-bit FreeBSD on x86-64 - # # - x86_64-unknown-illumos # 64-bit Illumos on x86-64 - x86_64-unknown-linux-musl # 64-bit Linux (kernel 2.6.32+, musl libc) - - x86_64-unknown-netbsd # 64-bit NetBSD on x86-64 - include: - # Tier 1 platforms ๐Ÿ† - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: i686-pc-windows-gnu - os: ubuntu-latest - cross: true - - target: i686-pc-windows-msvc - os: windows-latest - cross: true - - target: i686-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: x86_64-apple-darwin - os: macos-latest - cross: true - - target: x86_64-pc-windows-gnu - os: ubuntu-latest - cross: true - - target: x86_64-pc-windows-msvc - os: windows-latest - cross: true - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - cross: true - - # Tier 2 platforms ๐Ÿฅˆ - - target: aarch64-apple-darwin - os: macos-latest - cross: true - - target: aarch64-pc-windows-msvc - os: windows-latest - cross: true - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - cross: true - - target: arm-unknown-linux-gnueabi - os: ubuntu-latest - cross: true - - target: arm-unknown-linux-gnueabihf - os: ubuntu-latest - cross: true - - target: armv7-unknown-linux-gnueabihf - os: ubuntu-latest - cross: true - - target: mips-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: mips64-unknown-linux-gnuabi64 - os: ubuntu-latest - cross: true - - target: mips64el-unknown-linux-gnuabi64 - os: ubuntu-latest - cross: true - - target: mipsel-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: powerpc-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: powerpc64-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: powerpc64le-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: riscv64gc-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: s390x-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: x86_64-unknown-freebsd - os: ubuntu-latest - cross: true - # - target: x86_64-unknown-illumos - # os: ubuntu-latest - # cross: true - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - cross: true - - target: x86_64-unknown-netbsd - os: ubuntu-latest - cross: true - - runs-on: ${{ matrix.os }} + include: + # Tier 1 platforms ๐Ÿ† + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + cross: true + - target: i686-pc-windows-gnu + os: ubuntu-latest + cross: true + - target: i686-pc-windows-msvc + os: windows-latest + cross: true + - target: i686-unknown-linux-gnu + os: ubuntu-latest + cross: true + - target: x86_64-apple-darwin + os: macos-latest + cross: true + - target: x86_64-pc-windows-gnu + os: ubuntu-latest + cross: true + - target: x86_64-pc-windows-msvc + os: windows-latest + cross: true + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + cross: true + + # Tier 2 platforms ๐Ÿฅˆ + - target: aarch64-apple-darwin + os: macos-latest + cross: true + - target: aarch64-pc-windows-msvc + os: windows-latest + cross: true + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + cross: true + - target: arm-unknown-linux-gnueabi + os: ubuntu-latest + cross: true + - target: arm-unknown-linux-gnueabihf + os: ubuntu-latest + cross: true + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-latest + cross: true + - target: powerpc-unknown-linux-gnu + os: ubuntu-latest + cross: true + - target: powerpc64-unknown-linux-gnu + os: ubuntu-latest + cross: true + - target: powerpc64le-unknown-linux-gnu + os: ubuntu-latest + cross: true + - target: riscv64gc-unknown-linux-gnu + os: ubuntu-latest + cross: true + - target: s390x-unknown-linux-gnu + os: ubuntu-latest + cross: true + - target: x86_64-unknown-freebsd + os: ubuntu-latest + cross: true + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + cross: true + # - target: x86_64-unknown-netbsd + # os: ubuntu-latest + # cross: true + + runs-on: ${{ matrix.os }} steps: # Check out the repository code. - name: Checkout sources id: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Install the stable Rust toolchain. - name: Install stable toolchain @@ -160,26 +143,13 @@ jobs: toolchain: stable override: true - # Install the targets for the cross-compilation toolchain - - name: Install target - id: install-target - run: rustup target add ${{ env.TARGET }} - - - name: Install Cross and clean artifacts - run: | - # Install cross - cargo install cross - - # Clean the build artifacts - cargo clean --verbose - shell: bash - # Cache dependencies to speed up subsequent builds. - name: Cache dependencies id: cache-dependencies uses: actions/cache@v3 with: path: | + ~/.cargo ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ @@ -188,6 +158,21 @@ jobs: key: release-${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo- + # Install the targets for the cross-compilation toolchain + - name: Install target + id: install-target + run: rustup target add ${{ env.TARGET }} + + # Install the cross-compilation toolchain + - name: Install Cross and clean artifacts + run: | + # Install cross + cargo install cross + + # Clean the build artifacts + cargo clean --verbose + shell: bash + # Build the targets - name: Build targets id: build-targets @@ -225,11 +210,11 @@ jobs: steps: # Check out the repository code - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Install the stable Rust toolchain - name: Install stable toolchain - uses: actions-rs/toolchain@v1.0.6 + uses: actions-rs/toolchain@v1 with: toolchain: stable override: true @@ -305,7 +290,7 @@ jobs: VERSION: ${{ env.VERSION }} with: tag_name: v${{ env.VERSION }} - release_name: Random (VRD) ๐Ÿฆ€ v${{ env.VERSION }} + release_name: DateTime (DTT) ๐Ÿฆ€ v${{ env.VERSION }} body_path: ${{ github.workspace }}/CHANGELOG.md draft: true prerelease: false @@ -320,12 +305,12 @@ jobs: steps: # Check out the repository code - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Install the stable Rust toolchain - name: Install stable toolchain id: install-toolchain - uses: actions-rs/toolchain@v1.0.6 + uses: actions-rs/toolchain@v1 with: toolchain: stable override: true @@ -355,7 +340,7 @@ jobs: # Publish the Rust library to Crate.io - name: Publish Library to Crate.io id: publish-library - uses: actions-rs/cargo@v1.0.1 + uses: actions-rs/cargo@v1 env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }} with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a52e9f..3245237 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: steps: # Checkout the repository - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Setup Rust - name: Setup Rust @@ -54,7 +54,7 @@ jobs: # Only run this job on the main branch when a commit is pushed. if: github.ref == 'refs/heads/main' && github.event_name == 'push' id: generate-code-coverage - uses: actions-rs/cargo@v1.0.1 + uses: actions-rs/cargo@v1 with: command: xtask args: coverage