-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (64 loc) · 2.04 KB
/
ci.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI
on: push
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: false
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v6
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: nixpkgs-terraform
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build all packages
run: nix flake check --impure
env:
NIXPKGS_ALLOW_UNFREE: 1
templates:
if: false
strategy:
matrix:
template: [default, devenv]
fail-fast: true
runs-on: ubuntu-latest
timeout-minutes: 2
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v6
- name: Replace inputs on templates
run: sed -i 's/github:stackbuilders\/nixpkgs-terraform/github:stackbuilders\/nixpkgs-terraform\/${{ 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 }}
working-directory: ${{ steps.mktemp.outputs.tmpdir }}
- name: Run smoke test
run: nix develop --accept-flake-config --impure -c terraform --version
env:
NIXPKGS_ALLOW_UNFREE: 1
working-directory: ${{ steps.mktemp.outputs.tmpdir }}
release:
runs-on: ubuntu-latest
# needs: [templates]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v6
- run: nix develop --check
- run: nix develop -c npm ci
- run: nix develop -c npx semantic-release