ci: add test-demo-shell workflow #2
Workflow file for this run
This file contains hidden or 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: Test shell demo | |
| permissions: {} | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| distro: | |
| - "archlinux:latest" | |
| - "debian:12" | |
| - "debian:unstable" | |
| - "ubuntu:24.04" | |
| - "ubuntu:24.10" | |
| - "ubuntu:devel" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: 'actions/checkout@v4' | |
| with: { persist-credentials: false } | |
| - uses: DeterminateSystems/nix-installer-action@21a544727d0c62386e78b4befe52d19ad12692e3 #v17 | |
| - name: Build projects overview | |
| # FIXME: take default.nix file from overview | |
| # run: nix build .#overview | |
| run: | | |
| mkdir -p ./result/project/mitmproxy | |
| cat <<EOF >./result/project/mitmproxy/default.nix | |
| { | |
| ngipkgs ? | |
| import | |
| (fetchTarball "https://github.com/ngi-nix/ngipkgs/archive/master.tar.gz") | |
| { }, | |
| }: | |
| ngipkgs.demo-shell { | |
| programs.mitmproxy.enable = true; | |
| } | |
| EOF | |
| - name: Run and test shell environment | |
| env: | |
| DISTRO: ${{ matrix.distro }} | |
| NIX_CONFIG: | | |
| extra-substituters = https://ngi.cachix.org/ | |
| extra-trusted-public-keys = ngi.cachix.org-1:n+CAL72ROC3qQuLxIHpV+Tw5t42WhXmMhprAGkRSrOw= | |
| run: > | |
| docker run | |
| --privileged | |
| --volume ./result/project/mitmproxy/default.nix:/default.nix | |
| --volume "$(pwd):/ngipkgs" | |
| -e DISTRO="$DISTRO" | |
| "$DISTRO" | |
| /bin/bash -c "bash /ngipkgs/.github/workflows/test-demo-shell.sh" |