-
Notifications
You must be signed in to change notification settings - Fork 55
54 lines (50 loc) · 1.54 KB
/
ci.yml
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
name: CI
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.platform }}-build
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Fetch dependencies
run: cargo fetch
- name: Build in release mode
run: cargo build --release --frozen
test:
name: ${{ matrix.platform }}-test
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
# Test on macos-13 because the macos-14 runner doesn't come with php installed.
platform: [ubuntu-latest, windows-latest, macos-13]
env:
CLICOLOR_FORCE: 1
steps:
- uses: actions/checkout@v4
- name: Add Ruby for a test that requires it
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Fetch dependencies
run: cargo fetch
- name: Build in test mode
run: cargo build --tests --frozen
- name: Make mask available globally (windows)
run: copy ./target/debug/mask.exe ~/.cargo/bin/
if: matrix.platform == 'windows-latest'
- name: Make mask available globally (linux / mac)
run: cp ./target/debug/mask ~/.cargo/bin
if: matrix.platform != 'windows-latest'
- name: Run tests
run: cargo test --frozen
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify formatting is correct
run: cargo fmt --all -- --check