-
Notifications
You must be signed in to change notification settings - Fork 6
126 lines (116 loc) · 3.29 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
name: CI
on:
schedule:
- cron: '30 5 * * *'
push:
branches:
- master
paths:
- '**.cfg'
- '**.nims'
- '**.nim'
- '**.nimble'
- 'tests/**'
- '.github/workflows/ci.yml'
pull_request:
branches:
- '*'
paths:
- '**.cfg'
- '**.nims'
- '**.nim'
- '**.nimble'
- 'tests/**'
- '.github/workflows/ci.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ['windows-latest', 'macos-latest', 'ubuntu-latest']
compiler:
- name: nim
version: devel
- name: nim
version: version-1-6
- name: nim
version: version-1-4
- name: nim
version: version-1-2
- name: nim
version: version-1-0
- name: nimskull
version: '*'
exclude:
- os: windows-latest
compiler:
name: nimskull
name: '${{ matrix.os }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }})'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ci
- name: Setup Nim
if: matrix.compiler.name == 'nim'
uses: alaviss/[email protected]
with:
path: nim
version: ${{ matrix.compiler.version }}
- name: Setup Nimskull
id: nimskull
if: matrix.compiler.name == 'nimskull'
uses: alaviss/setup-nimskull@f6e8ade8ac51191024616216e5da0ee968d9da48
with:
version: ${{ matrix.compiler.version }}
- if: matrix.compiler.name == 'nimskull'
name: Fetch nimble's fork for nimskull
uses: actions/checkout@v4
with:
path: nimble
repository: alaviss/nimble
ref: nimskull
- if: matrix.compiler.name == 'nimskull'
name: Build nimble and add to PATH
shell: bash
run: |
cd nimble
nim c -d:release -o:nimble src/nimble.nim
cp nimble "$NIMSKULL_BIN/nimble"
# Add nimble binary folder to PATH too
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
env:
NIMSKULL_BIN: ${{ steps.nimskull.outputs.binPath }}
- name: Run tests
shell: bash
run: |
cd ci
#nimble --accept develop
#nimble --accept build
nimble --accept install
nimble test
- name: Build docs
if: ${{ matrix.docs }} == 'true'
shell: bash
run: |
cd ci
branch=${{ github.ref }}
branch=${branch##*/}
nimble doc --project --path="." --outdir:docs \
'--git.url:https://github.com/${{ github.repository }}' \
'--git.commit:${{ github.sha }}' \
"--git.devel:$branch" \
balls.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.os == 'ubuntu-latest' && matrix.compiler.name == 'nim' &&
matrix.compiler.version == 'devel'
uses: crazy-max/ghaction-github-pages@v1
with:
build_dir: ci/docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}