Skip to content

Commit 82bcf2a

Browse files
committed
Adding GitHub action
Adds GitHub action.
1 parent 30d2b88 commit 82bcf2a

2 files changed

Lines changed: 88 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/workflows/rust.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master dev ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
Formatting:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Install stable toolchain
17+
uses: dtolnay/rust-toolchain@stable
18+
with:
19+
toolchain: stable
20+
components: rustfmt
21+
22+
- name: Check format
23+
run: cargo fmt -- --check
24+
25+
Linting:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Install stable toolchain
32+
uses: dtolnay/rust-toolchain@stable
33+
with:
34+
toolchain: stable
35+
components: clippy
36+
37+
- name: Lint with clippy
38+
uses: actions-rs/clippy-check@v1
39+
with:
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
42+
Testing:
43+
needs: Formatting
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
build: [beta, stable, windows, macos]
49+
include:
50+
- build: macos
51+
os: macos-latest
52+
rust: stable
53+
- build: windows
54+
os: windows-latest
55+
rust: stable
56+
- build: beta
57+
os: ubuntu-latest
58+
rust: beta
59+
- build: stable
60+
os: ubuntu-latest
61+
rust: stable
62+
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v4
66+
67+
- name: Install ${{ matrix.rust }} toolchain
68+
uses: dtolnay/rust-toolchain@stable
69+
with:
70+
toolchain: ${{ matrix.rust }}
71+
72+
- name: Run tests
73+
uses: actions-rs/cargo@v1
74+
with:
75+
command: test
76+
args: --all --no-fail-fast

0 commit comments

Comments
 (0)