Skip to content

Add strategy matrix for toolchain and different OSs with caching #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: 🔨 Build

on:
pull_request:
Expand All @@ -10,17 +10,27 @@ env:

jobs:
build:
name: 🔨Build release
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: [stable, beta, nightly]
name: 🔨 Build release
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: 🔨Build release
- name: Install latest ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build release
run: cargo build --release

package:
name: 📦Check package generation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📦Check package generation
run: cargo package
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs
name: 📄 Build docs

on:
pull_request:
Expand All @@ -10,9 +10,9 @@ env:

jobs:
docs:
name: 📄Build docs
name: 📄 Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📄Build docs
- name: Build docs
run: cargo doc --verbose
19 changes: 19 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 👔 Check formatting

on:
pull_request:
push:
branches: ["main", "develop", "release"]

env:
CARGO_TERM_COLOR: always

jobs:
check_format:
name: 👔 Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check Formatting
run: cargo fmt -- --verbose --check --color auto

12 changes: 6 additions & 6 deletions .github/workflows/rust.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Code check

name: 🖋 Check lintig

on:
pull_request:
Expand All @@ -9,15 +10,14 @@ env:
CARGO_TERM_COLOR: always

jobs:
code_check:
name: 👔✒️Formatting and Linting
check_lint:
name: 🖋 Check linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 👔Check Formatting
run: cargo fmt -- --verbose --check --color auto
- name: ✒️Check linting
- name: Check linting
run: |
rustup component add clippy
set env RUSTFLAGS="-Dwarnings"
cargo clippy --workspace -- -D warnings

20 changes: 6 additions & 14 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Package
name: 📦 Package

on:
pull_request:
Expand All @@ -19,28 +19,20 @@ jobs:
# cargo install cargo-deny
# cargo deny check

package:
name: 🔨Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🔨Check package build
run: cargo package --verbose

cargo_check:
name: 📦Check package integrity
name: 📦 Check package integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📦Check package integrity
run: cargo check --verbose
- name: Check package integrity
run: cargo package --verbose

publish_dry_run:
name: 📢Publish dry-run
name: 📢 Publish dry-run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📢Publish dry run
- name: Publish dry run
run: cargo publish --dry-run --verbose

# dummy_publish:
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: 🧪 Tests

on:
pull_request:
Expand All @@ -10,9 +10,19 @@ env:

jobs:
test:
name: 🧪Run tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: [stable, beta, nightly]
name: 🧪 Run tests
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: 🧪Run tests
- name: Install latest ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v2
- name: Run tests
run: cargo test --verbose