1+ name : htmlparser CI
2+ on : [push, pull_request]
3+
4+ jobs :
5+ build :
6+ if : |
7+ !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
8+
9+ strategy :
10+ fail-fast : false
11+ matrix :
12+ branch : [devel]
13+ target :
14+ - os : linux
15+ cpu : amd64
16+ - os : linux
17+ cpu : i386
18+ - os : macos
19+ cpu : amd64
20+ - os : windows
21+ cpu : i386
22+ - os : windows
23+ cpu : amd64
24+ include :
25+ - target :
26+ os : linux
27+ builder : ubuntu-20.04
28+ - target :
29+ os : macos
30+ builder : macos-10.15
31+ - target :
32+ os : windows
33+ builder : windows-2019
34+ name : ' ${{ matrix.target.os }}-${{ matrix.target.cpu }} (${{ matrix.branch }})'
35+ runs-on : ${{ matrix.builder }}
36+
37+ defaults :
38+ run :
39+ shell : bash
40+ working-directory : htmlparser
41+
42+ steps :
43+ - uses : actions/setup-node@v4
44+ - name : Checkout htmlparser
45+ uses : actions/checkout@v4
46+ with :
47+ path : htmlparser
48+
49+ # - name: Install dependencies (Linux amd64)
50+ # if: runner.os == 'Linux' && matrix.target.cpu == 'amd64'
51+ # run: |
52+ # sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
53+ # --no-install-recommends -yq <packages here>
54+
55+ - name : Install dependencies (Linux i386)
56+ if : runner.os == 'Linux' && matrix.target.cpu == 'i386'
57+ working-directory : ${{ github.workspace }}
58+ run : |
59+ sudo dpkg --add-architecture i386
60+ sudo apt-fast update -qq
61+ sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
62+ --no-install-recommends -yq gcc-multilib g++-multilib \
63+ libssl-dev:i386
64+
65+ mkdir -p external/bin
66+ cat << EOF > external/bin/gcc
67+ #!/bin/bash
68+
69+ exec $(which gcc) -m32 "\$@"
70+ EOF
71+
72+ cat << EOF > external/bin/g++
73+ #!/bin/bash
74+
75+ exec $(which g++) -m32 "\$@"
76+ EOF
77+
78+ chmod 755 external/bin/gcc external/bin/g++
79+
80+ echo "$PWD/external/bin" >> "${GITHUB_PATH}"
81+
82+ # - name: Install dependencies (macOS)
83+ # if: runner.os == 'macOS'
84+ # run: brew install <packages here>
85+
86+ - name : Install dependencies (Windows)
87+ if : runner.os == 'Windows'
88+ working-directory : ${{ github.workspace }}
89+ run : |
90+ mkdir external
91+ if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
92+ arch=64
93+ else
94+ arch=32
95+ fi
96+ curl -L "https://nim-lang.org/download/mingw$arch.7z" -o "external/mingw$arch.7z"
97+ 7z x "external/mingw$arch.7z" -oexternal/
98+
99+ cygpath -aw "external/mingw$arch/bin" >> "${GITHUB_PATH}"
100+
101+ - name : Setup Nim
102+ 103+ with :
104+ path : nim
105+ version : ${{ matrix.branch }}
106+ architecture : ${{ matrix.target.cpu }}
107+
108+ - name : Run tests
109+ shell : bash
110+ run : testament all
111+
112+ - name : Build docs
113+ if : matrix.branch == 'master'
114+ run : nimble docs
115+
116+ - name : Deploy docs
117+ # to view docs on your own fork: push a gh-pages branch on your fork,
118+ # enable gh-pages in your fork
119+ # and remove `github.ref == 'refs/heads/master'` below
120+ if : |
121+ github.event_name == 'push' && github.ref == 'refs/heads/master' &&
122+ matrix.target.os == 'linux' && matrix.target.cpu == 'amd64' &&
123+ matrix.branch == 'master'
124+ uses : crazy-max/ghaction-github-pages@v4
125+ with :
126+ build_dir : htmlparser/htmldocs
127+ target_branch : gh-pages
128+ env :
129+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments