Skip to content

Commit

Permalink
CI: split jobs into different workflows + add build job
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedberg committed Nov 24, 2024
1 parent 83ed035 commit b993bad
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 25 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain: [ nightly, stable, 1.77.0 ]
name: [linux, windows, macos]
include:
- name: linux
os: ubuntu-latest
- name: windows
os: windows-latest
- name: macos
os: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{matrix.toolchain}}

- name: Build all target
run: cargo build --all-targets
22 changes: 22 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check format

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
format:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Format
run: cargo fmt -- --check
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check lint

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Lint
run: cargo clippy --all-targets -- -D warnings
26 changes: 1 addition & 25 deletions .github/workflows/checks.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code checks
name: Run tests

on:
push:
Expand All @@ -10,30 +10,6 @@ env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Lint
run: cargo clippy --all-targets -- -D warnings

format:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Format
run: cargo fmt --all -- --check

test_and_coverage:
runs-on: ubuntu-latest

Expand Down

0 comments on commit b993bad

Please sign in to comment.