forked from tinygo-org/tinygo
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.35 KB
/
nix.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
name: Nix
on:
pull_request:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nix-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pull musl
run: |
git submodule update --init lib/musl
- name: Restore LLVM source cache
uses: actions/cache/restore@v4
id: cache-llvm-source
with:
key: llvm-source-18-linux-nix-v1
path: |
llvm-project/compiler-rt
- name: Download LLVM source
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
run: make llvm-source
- name: Save LLVM source cache
uses: actions/cache/save@v4
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
path: |
llvm-project/compiler-rt
- uses: cachix/install-nix-action@v22
- name: Build
run: |
nix develop --ignore-environment --keep HOME --command bash -c "go install && set && ldd ~/go/bin/tinygo && strings ~/go/bin/tinygo | grep LLVMInitialize && ~/go/bin/tinygo version"
- name: Test
run: |
nix develop --ignore-environment --keep HOME --command bash -c "~/go/bin/tinygo build -o test ./testdata/cgo"