Skip to content

wip

wip #876

Workflow file for this run

name: build
on:
workflow_dispatch:
pull_request:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust-hello:
strategy:
matrix:
config:
# Darwin
- os: macos-12
package: default
test-bin: ./result/bin/rust-hello
- os: macos-12
package: rust-hello
test-bin: ./result/bin/rust-hello
- os: macos-12
package: rust-hello-aarch64-apple-darwin
test-bin: file ./result/bin/rust-hello
- os: macos-12
package: rust-hello-aarch64-unknown-linux-musl
test-bin: file ./result/bin/rust-hello
- os: macos-12
package: rust-hello-armv7-unknown-linux-musleabihf
test-bin: file ./result/bin/rust-hello
- os: macos-12
package: rust-hello-wasm32-unknown-unknown
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello.wasm
- os: macos-12
package: rust-hello-wasm32-wasi
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello.wasm
- os: macos-12
package: rust-hello-x86_64-apple-darwin
test-bin: ./result/bin/rust-hello
- os: macos-12
package: rust-hello-x86_64-pc-windows-gnu
test-bin: file ./result/bin/rust-hello.exe
- os: macos-12
package: rust-hello-x86_64-unknown-linux-musl
test-bin: file ./result/bin/rust-hello
- os: macos-12
package: rust-hello-debug
test-bin: ./result/bin/rust-hello
- os: macos-12
package: rust-hello-debug-aarch64-apple-darwin
test-bin: file ./result/bin/rust-hello
- os: macos-12
package: rust-hello-debug-aarch64-unknown-linux-musl
test-bin: file ./result/bin/rust-hello
- os: macos-12
package: rust-hello-debug-armv7-unknown-linux-musleabihf
test-bin: file ./result/bin/rust-hello
- os: macos-12
package: rust-hello-debug-wasm32-wasi
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello.wasm
- os: macos-12
package: rust-hello-debug-x86_64-apple-darwin
test-bin: ./result/bin/rust-hello
- os: macos-12
package: rust-hello-debug-x86_64-pc-windows-gnu
test-bin: file ./result/bin/rust-hello.exe
- os: macos-12
package: rust-hello-debug-x86_64-unknown-linux-musl
test-bin: file ./result/bin/rust-hello
# Linux
- os: ubuntu-22.04
package: default
test-bin: ./result/bin/rust-hello
- os: ubuntu-22.04
package: rust-hello
test-bin: ./result/bin/rust-hello
- os: ubuntu-22.04
package: rust-hello-aarch64-apple-darwin
test-bin: file ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-aarch64-unknown-linux-musl
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-armv7-unknown-linux-musleabihf
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-arm ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-wasm32-unknown-unknown
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello.wasm
- os: ubuntu-22.04
package: rust-hello-wasm32-wasi
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello.wasm
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-x86_64-apple-darwin
test-bin: file ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-x86_64-pc-windows-gnu
test-bin: nix shell --inputs-from . 'nixpkgs#wine64' -c wine64 ./result/bin/rust-hello.exe
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-x86_64-unknown-linux-musl
test-bin: ./result/bin/rust-hello
test-oci: |
docker load < ./result
docker run --rm rust-hello:$(nix eval --raw --override-input 'nixify' '.' ./examples/rust-hello#rust-hello-x86_64-unknown-linux-musl-oci.imageTag)
- os: ubuntu-22.04
package: rust-hello-debug
test-bin: ./result/bin/rust-hello
- os: ubuntu-22.04
package: rust-hello-debug-aarch64-apple-darwin
test-bin: file ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-aarch64-unknown-linux-musl
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-armv7-unknown-linux-musleabihf
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-arm ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-wasm32-wasi
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello.wasm
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-x86_64-apple-darwin
test-bin: file ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-x86_64-pc-windows-gnu
test-bin: nix shell --inputs-from . 'nixpkgs#wine64' -c wine64 ./result/bin/rust-hello.exe
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-x86_64-unknown-linux-musl
test-bin: ./result/bin/rust-hello
test-oci: |
docker load < ./result
docker run --rm rust-hello:$(nix eval --raw --override-input 'nixify' '.' ./examples/rust-hello#rust-hello-x86_64-unknown-linux-musl-oci.imageTag)
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@v4
with:
extra-conf: |
accept-flake-config = true
- uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: cachix/cachix-action@v12
with:
name: rvolosatovs
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L --show-trace --override-input 'nixify' '.' './examples/rust-hello#${{ matrix.config.package }}'
- run: ${{ matrix.config.test-bin }}
- run: nix build -L --show-trace --override-input 'nixify' '.' './examples/rust-hello#${{ matrix.config.package }}-oci'
if: ${{ matrix.config.package != 'default' && matrix.config.package != 'rust-hello' && matrix.config.package != 'rust-hello-debug' }}
- run: ${{ matrix.config.test-oci }}