-
Notifications
You must be signed in to change notification settings - Fork 10
125 lines (118 loc) · 3.32 KB
/
test.yml
File metadata and controls
125 lines (118 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
on:
push:
branches:
- 'master'
- 'release/*'
pull_request:
branches:
- 'master'
- 'release/*'
name: CI
jobs:
build:
name: Build workspace
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: stable
- version: 1.85.0 # MSRV
msrv: true
features:
- --no-default-features
- --features default
- --all-features
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust.version }}
override: true
profile: minimal
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Install PCSC development libraries
run: |
sudo apt-get update
sudo apt-get install -y libpcsclite-dev swig
- name: Use MSRV Cargo.toml # Don't include "cli" in workspace if using MSRV
if: ${{ matrix.rust.msrv }}
run: cp Cargo.toml.MSRV Cargo.toml
- name: Build
run: cargo build ${{ matrix.features }}
test:
name: Test with emulator
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: stable
- version: 1.85.0 # MSRV
msrv: true
steps:
- name: checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust.version }}
override: true
profile: minimal
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Use MSRV Cargo.toml # Don't include "cli" in workspace if using MSRV
if: ${{ matrix.rust.msrv }}
run: cp Cargo.toml.MSRV Cargo.toml
- name: Install PCSC development libraries
run: |
sudo apt-get update -y
sudo apt-get install -y swig libpcsclite-dev
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Test
run: |
cd ${{ github.workspace }}
python3 -m venv emulator_env
source emulator_env/bin/activate
pip install -U pip wheel
pip install -r coinkite/coinkite-tap-proto/emulator/requirements.txt
cargo test -p rust-cktap --features emulator
rust_fmt:
name: Rust fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: rustfmt
- name: Check fmt
run: cargo +nightly fmt --all
clippy_check:
name: Clippy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Install libpcsclite-dev
run: sudo apt install libpcsclite-dev
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings