forked from amazon-ion/ion-schema-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.85 KB
/
rust.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
name: CI Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
# We want to run on external PRs, but not on internal ones as push automatically builds
# H/T: https://github.com/Dart-Code/Dart-Code/commit/612732d5879730608baa9622bf7f5e5b7b51ae65
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'amzn/ion-schema-rust'
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Rustfmt
run: cargo fmt --verbose -- --check
# `clippy-check` will run `cargo clippy` on new pull requests. Due to a limitation in GitHub
# permissions, the behavior of the Action is different depending on the source of the PR. If the
# PR comes from the ion-schema-rust project itself, any suggestions will be added to the PR as comments.
# If the PR comes from a fork, any suggestions will be added to the Action's STDOUT for review.
# For details, see: https://github.com/actions-rs/clippy-check/issues/2
- name: Install Clippy
# The clippy check depends on setup steps defined above, but we don't want it to run
# for every OS because it posts its comments to the PR. These `if` checks limit clippy to
# only running on the Linux test. (The choice of OS was arbitrary.)
if: matrix.os == 'ubuntu-latest'
run: rustup component add clippy
- name: Run Clippy
if: matrix.os == 'ubuntu-latest'
uses: actions-rs/clippy-check@v1
with:
# Adding comments to the PR requires the GITHUB_TOKEN secret.
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features