Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Jan 1, 2024
1 parent 3306f5f commit c9a6632
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 43 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CI

on:
schedule:
- cron: "0 0 1 *"
push:
branches: [ staging, trying, master ]
pull_request:
Expand All @@ -16,6 +18,7 @@ jobs:

build:
name: Build

strategy:
matrix:
include:
Expand All @@ -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
10 changes: 3 additions & 7 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 --target ${{ matrix.TARGET }}
11 changes: 3 additions & 8 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ 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
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all -- --check

0 comments on commit c9a6632

Please sign in to comment.