TESTING: Upload tinygo binary as artifact #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: list packages | |
run: | | |
apt list --installed | |
- name: uninstall system llvm | |
run: | | |
apt remove llvm-16 llvm-17 llvm-18 -y | |
- 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 | |
- name: find and print Targets.def | |
run: | | |
find /usr/include/ -name Targets.def -exec sh -c 'echo {}; cat {}' \ || true; | |
- uses: cachix/install-nix-action@v30 | |
with: | |
install_url: https://releases.nixos.org/nix/nix-2.24.7/install | |
- name: Nix version | |
run: | | |
nix --version | |
- name: Build | |
run: | | |
nix develop --ignore-environment --keep HOME --command bash -c "go install" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: upload | |
path: "/home/runner/go/bin/tinygo" | |
- name: Test | |
run: | | |
nix develop --ignore-environment --keep HOME --command bash -c "~/go/bin/tinygo version && ~/go/bin/tinygo build -o test ./testdata/cgo" |