Skip to content

Commit 23ff86e

Browse files
authored
Add strategy matrix for toolchain and different OSs with caching (#54)
Add strategy matrix for `ubuntu-latest`, `windows-latest`, `macos-latest` and toolchain matrix for `stable`, `beta`, `nightly`. Additionally some basic caching for the CI jobs has been added and some other misc reformats of the CI jobs
1 parent d62890c commit 23ff86e

15 files changed

+208
-93
lines changed

.github/issue_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Description
2+
3+
<!-- Delete these comments later -->
4+
<!-- Put the description of the task here -->
5+
6+
### Checklist
7+
8+
* [ ] Connect all related issues, and project boards, add labels, assign people, milestones etc.
9+
* [ ] Make sure that this template is properly filled in and appropriate parts deleted

.github/pull_request_template.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Description
2+
3+
<!-- Delete these comments later -->
4+
<!-- Put the description of the task here -->
5+
6+
### Checklist
7+
8+
<!-- Don't delete these, check them with a mouse if completed -->
9+
* [ ] Add tests, documentation, update the changelog, etc.
10+
* [ ] Connect all issues, and project boards, add labels, assign people to the PR and the issue, etc.
11+
* [ ] Make sure that the PR description and title contain "Draft: " at the beginning if its not yet ready
12+
* [ ] Make sure that this template is properly filled in and appropriate parts deleted

.github/workflows/build.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: 🔨 Build
22

33
on:
44
pull_request:
@@ -10,17 +10,27 @@ env:
1010

1111
jobs:
1212
build:
13-
name: 🔨Build release
14-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
toolchain: [stable, beta, nightly]
17+
name: 🔨 Build release
18+
runs-on: ${{ matrix.os }}
1519
steps:
1620
- uses: actions/checkout@v2
17-
- name: 🔨Build release
21+
- name: Install latest ${{ matrix.toolchain }}
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: ${{ matrix.toolchain }}
25+
- uses: actions/cache@v3
26+
with:
27+
path: |
28+
~/.cargo/bin/
29+
~/.cargo/registry/index/
30+
~/.cargo/registry/cache/
31+
~/.cargo/git/db/
32+
target/
33+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
34+
- name: Build release
1835
run: cargo build --release
1936

20-
package:
21-
name: 📦Check package generation
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v2
25-
- name: 📦Check package generation
26-
run: cargo package

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docs
1+
name: 📄 Build docs
22

33
on:
44
pull_request:
@@ -10,9 +10,9 @@ env:
1010

1111
jobs:
1212
docs:
13-
name: 📄Build docs
13+
name: 📄 Build docs
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v2
17-
- name: 📄Build docs
17+
- name: Build docs
1818
run: cargo doc --verbose

.github/workflows/format.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 👔 Check formatting
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["main", "develop", "release"]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
check_format:
13+
name: 👔 Check formatting
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions-rs/toolchain@v1
18+
with:
19+
toolchain: stable
20+
override: true
21+
- uses: davidB/rust-cargo-make@v1
22+
- name: Check Formatting
23+
run: cargo make rust-fmt-check
24+
check_format_markdown:
25+
name: 🖋 Check markdown files
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Check out code
29+
uses: actions/checkout@v2
30+
- name: Markdown Linting Action
31+
uses: avto-dev/[email protected]
32+
with:
33+
args: "*.md"
34+
check_format_toml:
35+
name: 🪦 Check toml files
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Check out code
39+
uses: actions/checkout@v2
40+
- uses: actions-rs/toolchain@v1
41+
with:
42+
toolchain: stable
43+
override: true
44+
- uses: davidB/rust-cargo-make@v1
45+
- run: cargo make toml-fmt-check
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Code check
1+
2+
name: 🖋 Check linting
23

34
on:
45
pull_request:
@@ -9,15 +10,19 @@ env:
910
CARGO_TERM_COLOR: always
1011

1112
jobs:
12-
code_check:
13-
name: 👔✒️Formatting and Linting
13+
check_lint:
14+
name: 🖋 Check linting
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v2
17-
- name: 👔Check Formatting
18-
run: cargo fmt -- --verbose --check --color auto
19-
- name: ✒️Check linting
18+
- uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
override: true
22+
- uses: davidB/rust-cargo-make@v1
23+
- name: Check linting
2024
run: |
2125
rustup component add clippy
2226
set env RUSTFLAGS="-Dwarnings"
2327
cargo clippy --workspace -- -D warnings
28+

.github/workflows/package.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Package
1+
name: 📦 Package
22

33
on:
44
pull_request:
@@ -9,46 +9,28 @@ env:
99
CARGO_TERM_COLOR: always
1010

1111
jobs:
12-
# license:
13-
# name: 🏫License check
14-
# runs-on: ubuntu-latest
15-
# steps:
16-
# - uses: actions/checkout@v2
17-
# - name: 🏫Check license
18-
# run: |
19-
# cargo install cargo-deny
20-
# cargo deny check
21-
22-
package:
23-
name: 🔨Package
12+
license:
13+
name: 🏫License check
2414
runs-on: ubuntu-latest
2515
steps:
2616
- uses: actions/checkout@v2
27-
- name: 🔨Check package build
28-
run: cargo package --verbose
17+
- name: 🏫Check license
18+
run: |
19+
cargo install cargo-deny
20+
cargo deny check
2921
3022
cargo_check:
31-
name: 📦Check package integrity
23+
name: 📦 Check package integrity
3224
runs-on: ubuntu-latest
3325
steps:
3426
- uses: actions/checkout@v2
35-
- name: 📦Check package integrity
36-
run: cargo check --verbose
27+
- name: Check package integrity
28+
run: cargo package --verbose
3729

3830
publish_dry_run:
39-
name: 📢Publish dry-run
31+
name: 📢 Publish dry-run
4032
runs-on: ubuntu-latest
4133
steps:
4234
- uses: actions/checkout@v2
43-
- name: 📢Publish dry run
35+
- name: Publish dry run
4436
run: cargo publish --dry-run --verbose
45-
46-
# dummy_publish:
47-
# name: 📦⬆️📢Publish dummy
48-
# # needs: [license, package, cargo_check, publish_dry_run]
49-
# needs: [package, cargo_check, publish_dry_run]
50-
# runs-on: ubuntu-latest
51-
# steps:
52-
# - uses: actions/checkout@v2
53-
# - name: 📦⬆️📢Publish dry run
54-
# run: cargo publish --dry-run --verbose

.github/workflows/tests.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: 🧪 Tests
22

33
on:
44
pull_request:
@@ -10,9 +10,19 @@ env:
1010

1111
jobs:
1212
test:
13-
name: 🧪Run tests
14-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
toolchain: [stable, beta, nightly]
17+
name: 🧪 Run tests
18+
runs-on: ${{ matrix.os }}
1519
steps:
1620
- uses: actions/checkout@v2
17-
- name: 🧪Run tests
21+
- name: Install latest ${{ matrix.toolchain }}
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: ${{ matrix.toolchain }}
25+
- uses: actions/checkout@v2
26+
- name: Run tests
1827
run: cargo test --verbose
28+

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ target/
2424
workspace.code-workspace
2525

2626
# macOS
27-
.DS_Store
27+
.DS_Store
28+
29+
# Vim files
30+
*.vim

.rustfmt.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
max_width = 88
2-
ignore = ["."] # rustfmt does a poor job, and I don't want it ruining well-formatted code

0 commit comments

Comments
 (0)