-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.54 KB
/
build.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
44
45
46
47
48
49
50
51
name: Build
on: push
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Setup Cachix
uses: cachix/cachix-action@v14
with:
name: devenv
- name: Install devenv
run: nix-env -if https://install.devenv.sh/latest
- name: Run tests
run: devenv shell -- tests
templates:
runs-on: ubuntu-latest
needs: [test]
strategy:
matrix:
template:
- name: default
test: nix develop --accept-flake-config -c python --version
- name: devenv
test: nix develop --accept-flake-config --impure -c python --version
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Replace inputs on templates
run: sed -i 's/github:sestrella\/asdf2nix/github:sestrella\/asdf2nix\/${{ github.sha }}/g' templates/*/flake.nix
- name: Create a temporary directory
run: echo "tmpdir=$(mktemp -d)" >> "$GITHUB_OUTPUT"
id: mktemp
- name: Scaffold a new project
run: nix flake init -t ${{ github.workspace }}#${{ matrix.template.name }}
working-directory: ${{ steps.mktemp.outputs.tmpdir }}
- name: Run smoke test
run: ${{ matrix.template.test }}
working-directory: ${{ steps.mktemp.outputs.tmpdir }}