-
Notifications
You must be signed in to change notification settings - Fork 73
50 lines (43 loc) · 1.61 KB
/
api-check.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
name: Public API Check
on:
pull_request:
branches:
- master
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# The workflow may fail if we change the public API in a pull request.
# We allow fail on this action. But we should manually check if the changes are reasonable when we see a failed action.
# It would be good if the workflow returns a neutral status when we find API changes. But it is currently not
# possible with Github actions.
jobs:
check-public-api-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout mmtk-core
uses: actions/checkout@v2
with:
# Full git history needed
fetch-depth: 0
# cargo-public-api can be built with the latest stable toolchain.
- name: Install stable Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
# make it the active toolchain
override: true
# cargo-public-api needs a nightly toolchain installed in order to work.
# It does not have to be the active toolchain.
- name: Install nightly Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
- run: cargo --version
- run: cargo +nightly --version
- name: Install cargo-public-api
run: cargo install cargo-public-api
- name: API Diff
run: cargo public-api diff origin/${GITHUB_BASE_REF}..${{ github.event.pull_request.head.sha }} --deny=all