-
Notifications
You must be signed in to change notification settings - Fork 10
172 lines (158 loc) · 4.56 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: CI
on:
schedule:
- cron: '30 5 * * *'
push:
branches:
- master
paths:
- '**.cfg'
- '**.nims'
- '**.nim'
- '**.nimble'
- '**.sh'
- 'tests/**'
- '.github/workflows/ci.yml'
pull_request:
branches:
- '*'
paths:
- '**.cfg'
- '**.nims'
- '**.nim'
- '**.nimble'
- '**.sh'
- 'tests/**'
- '.github/workflows/ci.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
#os: ['windows-latest', 'macos-latest', 'ubuntu-latest']
#os: ['macos-latest', 'ubuntu-latest']
os: ['ubuntu-latest']
compiler:
- name: nim
version: devel
#- name: nim
# version: version-2-0
- name: nim
version: version-1-6
- name: nim
version: version-1-4
- name: nim
version: version-1-2
- name: nimskull
version: '^0.1.0-dev.21080'
name: '${{ matrix.os }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }})'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ci
fetch-depth: 0
# nimph will scream when this is used
#filter: tree:0
- if: matrix.compiler.name == 'nim'
name: Setup Nim
uses: alaviss/setup-nim@0.1.1
with:
path: nim
version: ${{ matrix.compiler.version }}
- if: matrix.compiler.name == 'nimskull'
id: nimskull
name: Setup Nimskull
uses: nim-works/setup-nimskull@0.1.0
with:
nimskull-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"
env:
NIMSKULL_BIN: ${{ steps.nimskull.outputs.bin-path }}
- name: Fetch libgit2
uses: actions/checkout@v4
with:
path: ci/libgit2
repository: libgit2/libgit2
ref: v1.7.1
- name: Setup libgit2
shell: bash
run: |
cd ci/libgit2
mkdir build
cd build
cmake ..
cmake --build . -- --quiet
- name: Run tests
shell: bash
run: |
mkdir $HOME/.nimble
cd ci
cp ci-bootstrap.cfg nim.cfg
./bootstrap-nonimble.sh
./nimph refresh
./nimph
./nimph doctor || true
cat nim.cfg
./nimph
./nimph doctor || true
cat nim.cfg
cd `./nimph path balls`
nim c --out:$HOME/balls balls.nim
cd -
echo "remove nim's config.nims...?"
ls -l `dirname \`which nim\``/../config/
rm `dirname \`which nim\``/../config/config.nims || true
soExt=
case "$RUNNER_OS" in
macOS)
soExt=dylib
;;
Linux)
soExt=so
esac
libgit2Lib=$(pwd)/libgit2/build/libgit2.$soExt
nim c --define:libgit2Lib="$libgit2Lib" --passC:"-I$(pwd)/libgit2/include" --define:ssl -r tests/test.nim
nim c --define:libgit2Lib="$libgit2Lib" --passC:"-I$(pwd)/libgit2/include" --define:ssl --define:release -r tests/test.nim
- name: Docs
if: matrix.compiler.version == 'version-1-6'
shell: bash
run: |
cd ci
branch=${{ github.ref }}
branch=${branch##*/}
mv ci-docs.cfg nim.cfg
rm -rf deps
mkdir deps
./nimph doctor || true
cat nim.cfg
nim doc --project --outdir:docs \
'--git.url:https://github.com/${{ github.repository }}' \
'--git.commit:${{ github.sha }}' \
"--git.devel:$branch" \
src/nimph.nim
# Ignore failures for older Nim
cp docs/{the,}index.html || true
- name: Pages
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.os == 'ubuntu-latest' && matrix.compiler.version == 'version-1-6'
uses: crazy-max/ghaction-github-pages@v1
with:
build_dir: ci/docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}