-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (76 loc) · 2.09 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
name: impulse CI
on:
push:
paths:
- 'tests/**'
- '**'
- 'impulse.nimble'
- '.github/workflows/ci.yml'
pull_request:
paths:
- 'tests/**'
- '**'
- 'impulse.nimble'
- '.github/workflows/ci.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
branch: [version-1-6, devel]
target: [linux, macos, windows]
include:
- target: linux
builder: ubuntu-latest
- target: macos
builder: macos-latest
- target: windows
builder: windows-latest
name: '${{ matrix.target }} (${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: impulse
- name: Setup Nim
uses: alaviss/[email protected]
with:
path: nim
version: ${{ matrix.branch }}
- name: Setup nimble & deps
shell: bash
run: |
cd impulse
nimble refresh -y
nimble install -y
- name: Run tests
shell: bash
run: |
cd impulse
nimble -y test
- name: Build docs
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.target == 'linux' && matrix.branch == 'devel'
shell: bash
run: |
cd impulse
branch=${{ github.ref }}
branch=${branch##*/}
nimble doc --project --outdir:docs \
'--git.url:https://github.com/${{ github.repository }}' \
'--git.commit:${{ github.sha }}' \
"--git.devel:$branch" \
impulse.nim
# Ignore failures for older Nim
cp docs/{the,}index.html || true
- name: Publish docs
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.target == 'linux' && matrix.branch == 'devel'
uses: crazy-max/ghaction-github-pages@v1
with:
build_dir: impulse/docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}