-
Notifications
You must be signed in to change notification settings - Fork 226
83 lines (80 loc) · 2.53 KB
/
test.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
name: Test Suite and Doc
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
DOC_LLVM_FEATURE: llvm17-0
DOC_LLVM_VERSION: '17.0'
DOC_PATH: target/doc
jobs:
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- name: Install Rust Stable
run: rustup toolchain install stable
- name: Install typos
run: cargo install typos-cli
- name: Run typos
run: typos .
tests:
name: "LLVM ${{ matrix.llvm-version[0] }}: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
llvm-version:
- ["4.0", "4-0"]
- ["5.0", "5-0"]
- ["6.0", "6-0"]
- ["7.0", "7-0"]
- ["8.0", "8-0"]
- ["9.0", "9-0"]
- ["10.0", "10-0"]
- ["11.0", "11-0"]
- ["12.0", "12-0"]
- ["13.0", "13-0"]
- ["14.0", "14-0"]
- ["15.0", "15-0"]
- ["16.0", "16-0"]
- ["17.0", "17-0"]
# only use ubuntu-22.04 for llvm 16 and higher
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
llvm-version: ["16.0", "16-0"]
- os: ubuntu-22.04
llvm-version: ["17.0", "17-0"]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: ${{ matrix.llvm-version[0] }}
- name: llvm-config
run: llvm-config --version --bindir --libdir
- name: Build
run: cargo build --release --features llvm${{ matrix.llvm-version[1] }} --verbose
- name: Run tests
run: cargo test --release --features llvm${{ matrix.llvm-version[1] }} --verbose
doc:
name: Documentation
runs-on: ubuntu-latest
needs: [typos, tests]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: KyleMayes/install-llvm-action@v1
with:
version: ${{ env.DOC_LLVM_VERSION }}
- name: Install Rust Nightly
run: rustup toolchain install nightly
- name: Build Documentation
run: cargo +nightly doc --features ${{ env.DOC_LLVM_FEATURE }},nightly --verbose
- name: Doc Index Page Redirection
run: echo '<meta http-equiv="refresh" content="1; url=inkwell/index.html">' > ${{ env.DOC_PATH }}/index.html
- name: Deploy Documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.DOC_PATH }}
force_orphan: true