-
Notifications
You must be signed in to change notification settings - Fork 3
145 lines (119 loc) · 3.4 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches: ['**', '!wip/**', '!dependabot/**']
pull_request:
branches: ['**', '!wip/**']
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
rust: [stable, 1.66.1, nightly]
fail-fast: false
continue-on-error: ${{ matrix.rust == 'nightly' }}
runs-on: ubuntu-latest
name: ${{ matrix.rust }}-x86_64-unknown-linux-gnu
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: false
- name: Install toolchain (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: clippy
default: true
- name: Setup caching
uses: Swatinem/rust-cache@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --workspace --all-features --all-targets
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --workspace --all-features --all-targets
docs:
runs-on: ubuntu-latest
name: Build documentation and books
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Checkout calypso-lang.github.io repository
uses: actions/checkout@v2
with:
repository: 'calypso-lang/calypso-lang.github.io'
path: 'docs/site'
- name: Setup caching
uses: actions/cache@v2
with:
path: |
docs/out/gui
docs/out/ref
docs/site/.svelte-kit
docs/site/node_modules
docs/site/build
key: rust-cache-docs
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Setup caching
uses: Swatinem/rust-cache@v1
- name: Install NodeJS v16
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
- name: Build The Calypso Book
run: |
mdbook build -d ../out/gui docs/guide
mdbook test -d ../out/gui docs/guide
- name: Build The Calypso Reference
run: |
mdbook build -d ../out/ref docs/reference
mdbook test -d ../out/ref docs/reference
- name: Build rustdocs
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: doc
args: --verbose --workspace --document-private-items
- name: Copy rustdocs
run: mv -f target/doc docs/out/rustdoc
- name: Install dependencies for site
run: |
yarn --cwd docs/site install
- name: Build site
run: |
yarn --cwd docs/site build
- name: Copy site to out directory
run: |
cp -r docs/site/build/* docs/out
- name: Check GitHub Pages status
uses: crazy-max/ghaction-github-status@v2
with:
pages_threshold: major_outage
- name: Deploy to GitHub Pages
if: ${{ success() && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
repo: "calypso-lang/calypso-lang.github.io"
build_dir: docs/out
keep_history: true
jekyll: false
env:
GH_PAT: ${{ secrets.GH_PAT }}
continue-on-error: true