@@ -3,8 +3,7 @@ on: [push, pull_request]
3
3
4
4
jobs :
5
5
build :
6
- if : |
7
- !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
6
+ if : !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
8
7
9
8
strategy :
10
9
fail-fast : false
@@ -97,87 +96,12 @@ jobs:
97
96
shell : bash
98
97
run : echo "${{ github.workspace }}/nim/bin" >> "${GITHUB_PATH}"
99
98
100
- - name : Get latest Nim commit hash
101
- id : versions
102
- shell : bash
103
- run : |
104
- getHash() {
105
- git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
106
- }
107
- nimHash=$(getHash nim-lang/Nim '${{ matrix.branch }}')
108
- csourcesHash=$(getHash nim-lang/csources)
109
- echo "::set-output name=nim::$nimHash"
110
- echo "::set-output name=csources::$csourcesHash"
111
-
112
- - name : Restore prebuilt Nim from cache
113
- id : nim-cache
114
- uses : actions/cache@v1
115
- with :
116
- path : nim
117
- key : ' nim-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nim }}'
118
-
119
- - name : Restore prebuilt csources from cache
120
- if : steps.nim-cache.outputs.cache-hit != 'true'
121
- id : csources-cache
122
- uses : actions/cache@v1
123
- with :
124
- path : csources/bin
125
- key : ' csources-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.csources }}'
126
-
127
- - name : Checkout Nim csources
128
- if : >
129
- steps.csources-cache.outputs.cache-hit != 'true' &&
130
- steps.nim-cache.outputs.cache-hit != 'true'
131
- uses : actions/checkout@v2
132
- with :
133
- repository : nim-lang/csources
134
- path : csources
135
- ref : ${{ steps.versions.outputs.csources }}
136
-
137
- - name : Checkout Nim
138
- if : steps.nim-cache.outputs.cache-hit != 'true'
139
- uses : actions/checkout@v2
99
+ - name : Setup Nim
100
+ uses : jiro4989/setup-nim-action@v1
140
101
with :
141
- repository : nim-lang/Nim
142
- path : nim
143
- ref : ${{ steps.versions.outputs.nim }}
144
-
145
- - name : Build Nim and associated tools
146
- if : steps.nim-cache.outputs.cache-hit != 'true'
147
- shell : bash
148
- run : |
149
- ncpu=
150
- ext=
151
- case '${{ runner.os }}' in
152
- 'Linux')
153
- ncpu=$(nproc)
154
- ;;
155
- 'macOS')
156
- ncpu=$(sysctl -n hw.ncpu)
157
- ;;
158
- 'Windows')
159
- ncpu=$NUMBER_OF_PROCESSORS
160
- ext=.exe
161
- ;;
162
- esac
163
- [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
164
-
165
- if [[ ! -e csources/bin/nim$ext ]]; then
166
- make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.target.cpu }}'
167
- else
168
- echo 'Using prebuilt csources'
169
- fi
170
- cp -v csources/bin/nim$ext nim/bin
171
-
172
- cd nim
173
- nim c koch
174
- ./koch boot -d:release
175
- ./koch tools -d:release
176
- # clean up to save cache space
177
- rm koch
178
- rm -rf nimcache
179
- rm -rf dist
180
- rm -rf .git
102
+ nim-version : ${{ matrix.branch }}
103
+ no-color : true # --noColor
104
+ yes : true # --yes
181
105
182
106
- name : Run fusion tests
183
107
shell : bash
@@ -205,3 +129,17 @@ jobs:
205
129
target_branch : gh-pages
206
130
env :
207
131
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
132
+
133
+ - name : Cache choosenim
134
+ id : cache-choosenim
135
+ uses : actions/cache@v1
136
+ with :
137
+ path : ~/.choosenim
138
+ key : ${{ runner.os }}-choosenim-devel-latest
139
+
140
+ - name : Cache nimble
141
+ id : cache-nimble
142
+ uses : actions/cache@v1
143
+ with :
144
+ path : ~/.nimble
145
+ key : ${{ runner.os }}-nimble-devel-latest
0 commit comments