From e2016d83877d90ada0798c9fcd0d58ea6cef7ccf Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Mon, 1 Jan 2024 10:46:07 +0300 Subject: [PATCH] update CI --- .github/workflows/ci.yaml | 50 +++++++++++++++-------------------- .github/workflows/clippy.yml | 12 +++------ .github/workflows/rustfmt.yml | 16 +++++------ 3 files changed, 31 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 09eaeda..971c653 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,8 +1,10 @@ name: CI on: + schedule: + - cron: "0 0 1 * *" push: - branches: [ staging, trying, master ] + branches: master pull_request: jobs: @@ -16,6 +18,7 @@ jobs: build: name: Build + strategy: matrix: include: @@ -27,66 +30,55 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: nightly - profile: minimal - target: ${{ matrix.target }} - override: true + targets: ${{ matrix.target }} - - uses: actions-rs/cargo@v1 - with: - command: build - args: --target ${{ matrix.target }} --release + - run: cargo build --target ${{ matrix.target }} --release + env: + RUSTFLAGS: -D warnings test: name: Test runs-on: ubuntu-latest - env: - RUST_BACKTRACE: 1 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: nightly - profile: minimal - override: true - name: Print enabled target features run: rustc --print=cfg -C target-cpu=native - - uses: actions-rs/cargo@v1 - with: - command: test + - run: cargo test + env: + RUST_BACKTRACE: 1 test-native: name: Test runs-on: ubuntu-latest - env: - RUST_BACKTRACE: 1 - RUSTFLAGS: -C target-cpu=native steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: nightly - profile: minimal - override: true - name: Print enabled target features run: rustc --print=cfg -C target-cpu=native - - uses: actions-rs/cargo@v1 - with: - command: test + - run: cargo test + env: + RUST_BACKTRACE: 1 + RUSTFLAGS: -C target-cpu=native diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 999d3dc..538dbe4 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -1,6 +1,6 @@ on: push: - branches: [ staging, trying, master ] + branches: master pull_request: name: Clippy check @@ -8,15 +8,11 @@ jobs: clippy_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: nightly - override: true components: clippy - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} + - run: cargo clippy diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 5e5fd48..76bd18e 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -1,6 +1,6 @@ on: push: - branches: [ staging, trying, master ] + branches: master pull_request: name: Code formatting check @@ -10,14 +10,10 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal - toolchain: stable - override: true + toolchain: 1.75.0 components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + + - run: cargo +stable fmt --all -- --check