Skip to content

Commit 27da563

Browse files
ThomasTJdevsrd424
authored andcommitted
update workflow
1 parent f28be77 commit 27da563

1 file changed

Lines changed: 54 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,64 @@ jobs:
1616
- windows-latest
1717
- macOS-latest
1818
version:
19-
- stable
19+
- binary:stable
20+
- binary:1.6.8
2021

2122
steps:
22-
- uses: actions/checkout@v1
23-
- uses: jiro4989/setup-nim-action@master
24-
with:
25-
nim-version: ${{ matrix.version }}
23+
- uses: actions/checkout@v4
2624

27-
- name: Print Nim version
28-
run: nim -v
2925

30-
- name: Print Nimble version
31-
run: nimble -v
26+
#
27+
# Nim
28+
#
29+
- name: Cache Nim binaries
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
nimdir
34+
~/.nimble
35+
key: "nim-${{ matrix.version }}-${{ matrix.os }}"
3236

33-
- name: Nimble Refresh
34-
run: nimble -y refresh
37+
- name: Check for cached Nim binaries
38+
id: nim-binaries-cache
39+
run: |
40+
if [ -f "nimdir/bin/nim" ]; then
41+
echo "found=true" >> $GITHUB_OUTPUT
42+
else
43+
echo "found=false" >> $GITHUB_OUTPUT
44+
fi
3545
36-
- name: Nimble Install dependencies
37-
run: nimble -y install --depsOnly
46+
- name: Install Nim (if not cached)
47+
if: steps.nim-binaries-cache.outputs.found == 'false'
48+
uses: iffy/install-nim@v5
49+
with:
50+
version: ${{ matrix.version }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3853

39-
- name: Build binaries
40-
run: nimble build -d:release
54+
- name: Add cached Nim to PATH
55+
if: steps.nim-binaries-cache.outputs.found == 'true'
56+
run: |
57+
echo "${{ github.workspace }}/nimdir/bin" >> $GITHUB_PATH
58+
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
59+
60+
61+
#
62+
# Nim
63+
#
64+
- name: Print Nim version
65+
run: |
66+
nim -v
67+
68+
- name: Print Nimble version
69+
run: |
70+
nimble -v
71+
72+
- name: Nimble Refresh
73+
run: nimble -y refresh
74+
75+
- name: Nimble Install dependencies
76+
run: nimble -y install --depsOnly
77+
78+
- name: Build binaries
79+
run: nimble build -d:release

0 commit comments

Comments
 (0)