index : static-web-server.git

ascending towards madness

author Jose Quintana <joseluisquintana20@gmail.com> 2021-06-22 7:38:22.0 +00:00:00
committer Jose Quintana <joseluisquintana20@gmail.com> 2021-06-22 7:38:22.0 +00:00:00
commit
d9a773a28dddf770def3e5a276b60bada6a5050b [patch]
tree
ec8aeabae760d9f11db3346857b8b77662a3a373
parent
35d5a1eec45b6a181bb22316fcef9a1ef57a2a0c
download
d9a773a28dddf770def3e5a276b60bada6a5050b.tar.gz

refactor: ci test suite for stable rust, nightly & beta toolchains



Diff

 .github/workflows/devel.yml | 168 ++++++++++++++++++++++++++++++---------------
 1 file changed, 114 insertions(+), 54 deletions(-)

diff --git a/.github/workflows/devel.yml b/.github/workflows/devel.yml
index 07d5f29..68d0034 100644
--- a/.github/workflows/devel.yml
+++ b/.github/workflows/devel.yml
@@ -1,73 +1,133 @@
name: devel

on:
  pull_request:
  push:
    branches:
    - 1.x
  schedule:
  - cron: '00 01 * * *'

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
  test:
    name: test
    runs-on: ${{ matrix.os }}
    env:
      CARGO: cargo
      # When CARGO is set to CROSS, this is set to `--target matrix.target`
      TARGET_FLAGS: ""
      # When CARGO is set to CROSS, TARGET_DIR includes matrix.target
      TARGET_DIR: ./target
      # Emit backtraces on panics
      RUST_BACKTRACE: 1
    strategy:
      matrix:
        build:
        - pinned
        - stable
        - beta
        - linux-musl
        - linux-musl-arm64
        - linux-gnu
        - linux-gnu-arm64
        - linux-arm-gnueabihf
        - macos
        - macos-arm64
        - windows-msvc
        - windows-msvc-arm64
        include:
        - build: pinned
          os: ubuntu-20.04
          rust: 1.53.0
        - build: stable
          os: ubuntu-20.04
          rust: stable
        - build: beta
          os: ubuntu-20.04
          rust: beta
        - build: linux-musl
          os: ubuntu-20.04
          rust: nightly
          target: x86_64-unknown-linux-musl
        - build: linux-musl-arm64
          os: ubuntu-20.04
          rust: nightly
          target: aarch64-unknown-linux-musl
        - build: linux-gnu
          os: ubuntu-20.04
          rust: nightly
          target: x86_64-unknown-linux-gnu
        - build: linux-gnu-arm64
          os: ubuntu-20.04
          rust: nightly
          target: aarch64-unknown-linux-gnu
        - build: linux-arm-gnueabihf
          os: ubuntu-20.04
          rust: nightly
          target: arm-unknown-linux-gnueabihf
        - build: macos
          os: macos-latest
          rust: nightly
          target: x86_64-apple-darwin
        - build: macos-arm64
          os: macos-latest
          rust: nightly
          target: aarch64-apple-darwin
        - build: windows-msvc
          os: windows-2019
          rust: nightly
          target: x86_64-pc-windows-msvc
        - build: windows-msvc-arm64
          os: windows-2019
          rust: nightly
          target: aarch64-pc-windows-msvc

    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
    - name: Checkout repository
      uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
    - name: Install Rust
      uses: actions-rs/toolchain@v1
      with:
        toolchain: ${{ matrix.rust }}
        profile: minimal
        override: true

      - name: Run cargo check
        uses: actions-rs/cargo@v1
        with:
          command: check
    - name: Use Cross
      if: matrix.target != ''
      run: |
        cargo install cross
        echo "CARGO=cross" >> $GITHUB_ENV
        echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
        echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV

  test:
    name: Test Suite
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
    - name: Run tests
      run: ${{ env.CARGO }} test --verbose

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
    - name: Build static-web-server and crates
      run: ${{ env.CARGO }} build --verbose

      - name: Run cargo test
        uses: actions-rs/cargo@v1
        with:
          command: test
  checks:
    name: checks
    runs-on: ubuntu-20.04

  lints:
    name: Lints
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
    - name: Checkout repository
      uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt, clippy
    - name: Install stable toolchain
      uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: stable
        override: true
        components: rustfmt, clippy

      - name: Run cargo fmt
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check
    - name: Check formatting
      run: |
        cargo fmt --all -- --check

      - name: Run cargo clippy
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features -- -D warnings
    - name: Check via Clippy
      uses: actions-rs/clippy-check@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        args: --all-features -- -D warnings