Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from DeterminateSystems/general-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins authored May 1, 2024
2 parents 8ffe01d + b0a92f4 commit af9947e
Show file tree
Hide file tree
Showing 11 changed files with 315 additions and 604 deletions.
53 changes: 26 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,38 @@ env:
REPO: ${{ github.event.repository.name }}

jobs:
check:
environment: check
ci:
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- name: Check Nixpkgs input in flake
uses: DeterminateSystems/flake-checker-action@v5
with:
extra-conf: |
binary-caches = https://cache.nixos.org https://${{ secrets.CACHIX_CACHE }}.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.CACHIX_TRUSTED_PUBLIC_KEY }}
trusted-substituters = https://cache.nixos.org https://${{ secrets.CACHIX_CACHE }}.cachix.org
trusted-users = root runner
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Set up Nix environment
fail-mode: true

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v10

- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v4

- name: nix flake check
run: |
nix develop --command direnv allow
eval "$(nix develop --command direnv export bash)"
echo "$PATH" >> $GITHUB_PATH
- name: Binary cache setup
nix flake check --all-systems
- name: Display package contents
run: |
cachix authtoken ${{ secrets.CACHIX_AUTH_TOKEN }}
cachix use ${{ secrets.CACHIX_CACHE }}
- name: Build all
run: nix build -L
- name: Run fully test suite
run: run-test-suite
- name: Cache development environment
nix build ".#hello-wasm-pkg"
nix develop --command tree ./result
- name: Build all packages
run: |
nix develop --profile ${{ env.REPO }}
cachix push ${{ secrets.CACHIX_CACHE }} ${{ env.REPO }}
- name: Cache build artifacts
for pkg in hello-wasm-pkg hello-wasmedge-exec hello-wasmtime-exec; do
nix build ".#${pkg}"
done
- name: Run scripts
run: |
nix flake archive --json \
| jq -r '.path,(.inputs|to_entries[].value.path)' \
| cachix push "${{ secrets.CACHIX_CACHE }}"
nix run ".#hello-wasmedge-exec"
nix run ".#hello-wasmtime-exec"
31 changes: 31 additions & 0 deletions .github/workflows/flakehub-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Push dev shell to FlakeHub Cache

on:
push:
branches: [main]

jobs:
push-dev-shell-to-flakehub-cache:
env:
ACTIONS_STEP_DEBUG: true
runs-on: ${{ matrix.systems.runner }}
permissions:
id-token: "write"
contents: "read"
strategy:
matrix:
systems:
- nix-system: "aarch64-darwin"
runner: "macos-latest-xlarge"
- nix-system: "x86_64-darwin"
runner: "macos-12"
- nix-system: "x86_64-linux"
runner: "ubuntu-22.04"
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
with:
use-flakehub: true
- name: Build dev shell for ${{ matrix.systems.nix-system }} on ${{ matrix.systems.runner }}
run: nix build .#devShells.${{ matrix.systems.nix-system }}.default
21 changes: 21 additions & 0 deletions .github/workflows/flakehub-publish-rolling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Publish every Git push to main to FlakeHub"

on:
push:
branches:
- "main"

jobs:
flakehub-publish:
runs-on: "ubuntu-22.04"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v4"
- uses: "DeterminateSystems/nix-installer-action@v10"
- uses: "DeterminateSystems/flakehub-push@v3"
with:
name: "DeterminateSystems/nix-wasm-example"
rolling: true
visibility: "public"
Loading

0 comments on commit af9947e

Please sign in to comment.