Skip to content

Commit 9b8b44f

Browse files
author
Stjepan Glavina
committed
Add CI
1 parent 1059d24 commit 9b8b44f

File tree

5 files changed

+154
-0
lines changed

5 files changed

+154
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: stjepang

.github/workflows/build-and-test.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build_and_test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
rust: [nightly, beta, stable, 1.39.0]
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set current week of the year in environnement
21+
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macOS')
22+
run: echo "::set-env name=CURRENT_WEEK::$(date +%V)"
23+
24+
- name: Set current week of the year in environnement
25+
if: startsWith(matrix.os, 'windows')
26+
run: echo "::set-env name=CURRENT_WEEK::$(Get-Date -UFormat %V)"
27+
28+
- name: Install latest ${{ matrix.rust }}
29+
uses: actions-rs/toolchain@v1
30+
with:
31+
toolchain: ${{ matrix.rust }}
32+
profile: minimal
33+
override: true
34+
35+
- name: Run basic cargo check
36+
uses: actions-rs/cargo@v1
37+
with:
38+
command: check
39+
args: --all --bins --all-features
40+
41+
- name: Run cargo check
42+
if: startsWith(matrix.rust, '1.39.0') == false
43+
uses: actions-rs/cargo@v1
44+
with:
45+
command: check
46+
args: --all --benches --bins --examples --tests --all-features
47+
48+
- name: Run cargo check (without dev-dependencies to catch missing feature flags)
49+
if: startsWith(matrix.rust, 'nightly')
50+
uses: actions-rs/cargo@v1
51+
with:
52+
command: check
53+
args: -Z features=dev_dep
54+
55+
- name: Run cargo test
56+
if: startsWith(matrix.rust, '1.39.0') == false
57+
uses: actions-rs/cargo@v1
58+
with:
59+
command: test

.github/workflows/cross.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Cross compile
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
cross:
11+
name: Cross compile
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
17+
steps:
18+
- uses: actions/checkout@master
19+
20+
- name: Install nightly
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: nightly
24+
override: true
25+
26+
- name: Install docker
27+
if: startsWith(matrix.os, 'ubuntu')
28+
run: sudo apt install docker
29+
30+
- name: Install cross
31+
run: cargo install cross
32+
33+
- name: Android
34+
if: startsWith(matrix.os, 'ubuntu')
35+
run: cross test --target arm-linux-androideabi
36+
37+
- name: NetBSD
38+
if: startsWith(matrix.os, 'ubuntu')
39+
run: cross build --target x86_64-unknown-netbsd
40+
41+
- name: FreeBSD
42+
if: startsWith(matrix.os, 'ubuntu')
43+
run: cross build --target x86_64-unknown-freebsd
44+
45+
- name: iOS
46+
if: startsWith(matrix.os, 'macos')
47+
run: cross build --target aarch64-apple-ios

.github/workflows/lint.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
clippy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set current week of the year in environnement
16+
run: echo "::set-env name=CURRENT_WEEK::$(date +%V)"
17+
18+
- uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
profile: minimal
22+
components: clippy
23+
24+
- uses: actions-rs/clippy-check@v1
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
args: --all-features -- -W clippy::all

.github/workflows/security.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Security audit
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
security_audit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set current week of the year in environnement
16+
run: echo "::set-env name=CURRENT_WEEK::$(date +%V)"
17+
18+
- uses: actions-rs/audit-check@v1
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)