-
-
Notifications
You must be signed in to change notification settings - Fork 52
95 lines (79 loc) · 2.81 KB
/
build.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
name: Build
on:
push:
paths:
- 'src/**.nim'
- '.github/workflows/*.yml'
- '.github/workflows/*.yaml'
- '.pre-commit-config.yaml'
- '.gitignore'
jobs:
build:
if: |
!contains(github.event.head_commit.message, '[skip ci]')
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest]
node: [12, 13, 14, 15, 16, 17]
nim-channel: [stable, devel]
name: ${{ matrix.platform }}-${{ matrix.node }}-${{ matrix.nim-channel }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ matrix.nim-channel }}
no-color: true # --noColor
- name: Setup NodeJS ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: pre-commit/action@v2.0.3
if: runner.os == 'Linux'
# - uses: juancarlospaco/nimpretty-action@main
# with:
# folders: "src"
- name: Set Environment Variables
uses: allenevans/set-env@v2.0.0
with:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
NODE_OPTIONS: "--unhandled-rejections=warn"
CMD: "nim doc -b:js -d:nodejs -d:nimExperimentalAsyncjsThen -d:nimStrictDelete -d:nimPreviewFloatRoundtrip -d:nimPreviewDotLikeOps --experimental:strictFuncs --experimental:strictEffects --index:on --project --styleCheck:usages --styleCheck:hint --outdir:../../docs"
CMD2: "nim js -d:nodejs -d:nimExperimentalAsyncjsThen -d:nimStrictDelete -d:nimPreviewFloatRoundtrip --experimental:strictFuncs --experimental:strictEffects --styleCheck:usages --styleCheck:hint"
# https://developer.ibm.com/languages/node-js/blogs/nodejs-15-release-blog
- name: Generate Documentation
shell: bash
run: |
cd src/nodejs/
for i in *.nim; do
$CMD $i
done
- name: Clean out
shell: bash
run: |
rm --verbose --force --recursive docs/*.idx
rm --verbose --force --recursive docs/nimcache/*.*
rm --verbose --force --recursive docs/nimcache/runnableExamples/*.*
- name: Commit Docs
if: |
github.event_name == 'push' && github.ref == 'refs/heads/main' && runner.os == 'Linux' &&
matrix.platform == 'ubuntu-latest' && matrix.architecture == 'x64' && matrix.node == '17'
uses: EndBug/add-and-commit@v4 # Commit everything to Git repo
with:
add: 'docs'
force: true
message: 'Fully Automated Luxury Nim'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Test GUI
# shell: bash
# run: |
# cd tests/
# for i in *.nim; do
# $CMD $i
# done
# TODO: check
# for i in *.nim; do
# $CMD2 $i
# done