-
Notifications
You must be signed in to change notification settings - Fork 50
106 lines (100 loc) · 2.73 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
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
name: CI
on:
push:
branches: [ trunk ]
pull_request:
branches: [ trunk ]
env:
BUNDLE_PATH: /tmp/.bundle
GEM_HOME: /tmp/.bundle
GEM_PATH: /tmp/.bundle
TERM: xterm256
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.63.0
components: clippy
override: true
profile: minimal
- run: cargo clippy --all --all-features -- -D warnings
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: |
sudo apt-get install -y shellcheck
./script/lints/lint_fixtures.sh
./script/lints/lint_scripts.sh
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: native
- os: ubuntu-20.04
target: native
- os: macos-latest
target: native
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
with:
submodules: true
- if: runner.os == 'macOS'
uses: actions-rs/toolchain@v1
with:
toolchain: 1.63.0
target: aarch64-apple-darwin
default: true
override: true
profile: minimal
- if: runner.os != 'macOS'
uses: actions-rs/toolchain@v1
with:
toolchain: 1.63.0
override: true
profile: minimal
target: aarch64-unknown-linux-gnu
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.target }}-cargo-2-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v2
with:
path: |
librubyfmt/ruby_checkout
key: ${{ runner.os }}-${{ matrix.target }}-ruby-v1-${{ hashFiles('.git/modules/librubyfmt/ruby_checkout/HEAD') }}
- if: runner.os == 'macOS'
run: |
brew install automake bison
echo "/usr/local/opt/bison/bin:$PATH" >> $GITHUB_PATH
- run: ./script/test.sh
env:
TARGET: ${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: rubyfmt-artifact-${{ matrix.os }}-${{ matrix.target }}
path: target/${{ matrix.target == 'native' && 'release' || format('{0}/release', matrix.target) }}/rubyfmt-main