-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (83 loc) · 2.25 KB
/
Copy pathci.yml
File metadata and controls
88 lines (83 loc) · 2.25 KB
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
name: test C & JS
on:
push:
branches-ignore:
- 'feat-*'
paths:
- '**/*.nim'
- './*.nimble'
- 'tests/**'
- '.github/workflows/ci.yml'
pull_request:
workflow_dispatch:
release:
types: [published]
env:
nim-version: '2.2.8'
build_exe_cmd: 'nimble build --warning[Spacing]:off'
permissions:
contents: write
jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v4
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-v2
- uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ env.nim-version }}
- name: BuildC
run: ${{ env.build_exe_cmd }}
- name: Test C backend
run: nimble test
- name: BuildJs
if: &linux-only runner.os == 'Linux'
run: nimble buildJs -d:nodejs --warning[Spacing]:off
- name: Test NodeJS backend
if: *linux-only
run: nimble testNodeJs
- name: BuildJsLib
if: *linux-only
run: nimble buildJsLib --warning[Spacing]:off
- name: Test es6 backend
if: *linux-only
run: nimble testJsLib
- name: setup wasi sdk
if: *linux-only
uses: konsumer/install-wasi-sdk@v1
- name: BuildWasm
if: *linux-only
continue-on-error: ${{ github.event_name == 'release' }}
run: |
nimble install https://github.com/nimpylib/wasm_backend
nimble buildWasm --warning[Spacing]:off || echo "wasm failed"
- name: Stage release assets
if: &release-only github.event_name == 'release'
shell: bash
run: |
mkdir release-assets
extension=
if [[ "$RUNNER_OS" == Windows ]]; then
extension=.exe
fi
mv "bin/npython$extension" \
"release-assets/npython-$RUNNER_OS-$RUNNER_ARCH$extension"
if [[ "$RUNNER_OS" == Linux ]]; then
mv bin/* release-assets/
fi
- name: Upload release assets
if: *release-only
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release upload "${{ github.event.release.tag_name }}"
release-assets/* --clobber