-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (53 loc) · 1.58 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
55
56
57
58
59
60
61
62
63
64
65
66
######################################################################
# Copyright (c) 2022 Silvio Clecio (silvioprog) <[email protected]>
#
# SPDX-License-Identifier: MIT
######################################################################
name: CI/CD
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
test: false
publish: true
- target: x86_64-apple-darwin
test: false
os: macos-11
- target: aarch64-apple-darwin
os: macos-11
- target: x86_64-pc-windows-msvc
test: false
os: windows-2022
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.job.target }}
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.job.target }}
- name: Cargo test
if: matrix.job.test
uses: actions-rs/cargo@v1
with:
command: test
args: --target ${{ matrix.job.target }}
- name: Cargo publish
if: startsWith(github.ref, 'refs/tags/') && matrix.job.publish
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_TOKEN }} -v