-
Notifications
You must be signed in to change notification settings - Fork 12
173 lines (160 loc) · 5.67 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: threading
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
max-parallel: 20
matrix:
branch: [master]
target:
- os: linux
cpu: amd64
nim_branch: devel
- os: linux
cpu: amd64
nim_branch: version-2-0
- os: linux
cpu: amd64
nim_branch: version-1-6
# - os: linux
# cpu: i386
# nim_branch: devel
# - os: linux
# cpu: i386
# nim_branch: version-2-0
# - os: linux
# cpu: i386
# nim_branch: version-1-6
- os: macos
cpu: amd64
nim_branch: devel
- os: macos
cpu: amd64
nim_branch: version-2-0
- os: macos
cpu: amd64
nim_branch: version-1-6
- os: windows
cpu: amd64
nim_branch: devel
- os: windows
cpu: amd64
nim_branch: version-2-0
- os: windows
cpu: amd64
nim_branch: version-1-6
- os: windows
cpu: i386
nim_branch: devel
- os: windows
cpu: i386
nim_branch: version-2-0
- os: windows
cpu: i386
nim_branch: version-1-6
include:
- target:
os: linux
builder: ubuntu-latest
- target:
os: macos
builder: macos-latest
- target:
os: windows
builder: windows-latest
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-nim-${{ matrix.target.nim_branch }} (${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
env:
NIM_DIR: nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }}
NIM_BRANCH: ${{ matrix.target.nim_branch }}
NIM_ARCH: ${{ matrix.target.cpu }}
steps:
- name: Checkout threading
uses: actions/checkout@v4
with:
path: threading
submodules: false
- name: Restore MinGW-W64 (Windows) from cache
if: runner.os == 'Windows'
id: windows-mingw-cache
uses: actions/cache@v3
with:
path: external/mingw-${{ matrix.target.cpu }}
key: 'mingw-${{ matrix.target.cpu }}'
- name: Restore Nim DLLs dependencies (Windows) from cache
if: runner.os == 'Windows'
id: windows-dlls-cache
uses: actions/cache@v3
with:
path: external/dlls-${{ matrix.target.cpu }}
key: 'dlls-${{ matrix.target.cpu }}'
- name: Install MinGW64 dependency (Windows)
if: >
steps.windows-mingw-cache.outputs.cache-hit != 'true' &&
runner.os == 'Windows'
shell: bash
run: |
mkdir -p external
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
MINGW_URL="https://github.com/brechtsanders/winlibs_mingw/releases/download/14.1.0posix-18.1.8-12.0.0-ucrt-r3/winlibs-x86_64-posix-seh-gcc-14.1.0-mingw-w64ucrt-12.0.0-r3.7z"
ARCH=64
else
MINGW_URL="https://github.com/brechtsanders/winlibs_mingw/releases/download/14.1.0posix-18.1.8-12.0.0-ucrt-r3/winlibs-i686-posix-dwarf-gcc-14.1.0-mingw-w64ucrt-12.0.0-r3.7z"
ARCH=32
fi
curl -L "$MINGW_URL" -o "external/mingw-${{ matrix.target.cpu }}.7z"
7z x -y "external/mingw-${{ matrix.target.cpu }}.7z" -oexternal/
mv external/mingw$ARCH external/mingw-${{ matrix.target.cpu }}
- name: Install DLLs dependencies (Windows)
if: >
steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
runner.os == 'Windows'
shell: bash
run: |
mkdir -p external
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }}
- name: Path to cached dependencies (Windows)
if: >
runner.os == 'Windows'
shell: bash
run: |
echo '${{ github.workspace }}'"/external/mingw-${{ matrix.target.cpu }}/bin" >> $GITHUB_PATH
echo '${{ github.workspace }}'"/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH
- name: Restore Nim from cache
if: >
steps.nim-compiler-cache.outputs.cache-hit != 'true' &&
matrix.target.nim_branch != 'devel'
id: nim-compiler-cache
uses: actions/cache@v3
with:
path: '${{ github.workspace }}/nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }}'
key: 'nim-${{ matrix.target.cpu }}-${{ matrix.target.nim_branch }}'
- name: Setup Nim
uses: alaviss/[email protected]
with:
path: 'nim'
version: ${{ matrix.target.nim_branch }}
architecture: ${{ matrix.target.cpu }}
- name: Run tests
run: |
cd threading
nimble --threads:on --gc:arc test
# - name: Build docs
# if: matrix.branch == 'devel'
# run: nimble docs
# - name: Deploy docs
# # to view docs on your own fork: push a gh-pages branch on your fork,
# # enable gh-pages in your fork
# # and remove `github.ref == 'refs/heads/master'` below
# if: |
# github.event_name == 'push' && github.ref == 'refs/heads/master' &&
# matrix.target.os == 'linux' && matrix.target.cpu == 'amd64' &&
# matrix.branch == 'devel'
# uses: crazy-max/ghaction-github-pages@v1
# with:
# build_dir: fusion/htmldocs
# target_branch: gh-pages
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}