-
Notifications
You must be signed in to change notification settings - Fork 16
129 lines (110 loc) · 3.7 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
name: Fusion CI
on: [push, pull_request]
jobs:
build:
if: |
!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
strategy:
fail-fast: false
matrix:
branch: [version-1-0, version-1-2, version-1-4, devel]
target:
- os: linux
cpu: amd64
- os: linux
cpu: i386
- os: macos
cpu: amd64
- os: windows
cpu: i386
- os: windows
cpu: amd64
include:
- target:
os: linux
builder: ubuntu-20.04
- target:
os: macos
builder: macos-10.15
- target:
os: windows
builder: windows-2019
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
defaults:
run:
shell: bash
working-directory: fusion
steps:
- uses: actions/setup-node@v4
- name: Checkout fusion
uses: actions/checkout@v2
with:
path: fusion
# - name: Install dependencies (Linux amd64)
# if: runner.os == 'Linux' && matrix.target.cpu == 'amd64'
# run: |
# sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
# --no-install-recommends -yq <packages here>
- name: Install dependencies (Linux i386)
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
working-directory: ${{ github.workspace }}
run: |
sudo dpkg --add-architecture i386
sudo apt-fast update -qq
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
--no-install-recommends -yq gcc-multilib g++-multilib \
libssl-dev:i386
mkdir -p external/bin
cat << EOF > external/bin/gcc
#!/bin/bash
exec $(which gcc) -m32 "\$@"
EOF
cat << EOF > external/bin/g++
#!/bin/bash
exec $(which g++) -m32 "\$@"
EOF
chmod 755 external/bin/gcc external/bin/g++
echo "$PWD/external/bin" >> "${GITHUB_PATH}"
# - name: Install dependencies (macOS)
# if: runner.os == 'macOS'
# run: brew install <packages here>
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
working-directory: ${{ github.workspace }}
run: |
mkdir external
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
arch=64
else
arch=32
fi
curl -L "https://nim-lang.org/download/mingw$arch.7z" -o "external/mingw$arch.7z"
7z x "external/mingw$arch.7z" -oexternal/
cygpath -aw "external/mingw$arch/bin" >> "${GITHUB_PATH}"
- name: Setup Nim
uses: alaviss/[email protected]
with:
path: nim
version: ${{ matrix.branch }}
architecture: ${{ matrix.target.cpu }}
- name: Run tests
shell: bash
run: nimble 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@v2
with:
build_dir: fusion/htmldocs
target_branch: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}