-
-
Notifications
You must be signed in to change notification settings - Fork 17
95 lines (76 loc) · 2.26 KB
/
build-test.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build and test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
cargo_test:
name: Cargo tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: novops
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo
- run: nix develop -c make test
docker_build:
name: Docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: novops
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# Podman uses Buildah and cache is kept under $TMPDIR/buildah-cache
- uses: actions/cache@v3
with:
path: |
$TMPDIR/buildah-cache
key: ${{ runner.os }}-${{ runner.arch }}-cargo
- run: env | grep TMP
- run: nix develop -c make build-image
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: novops-binary
path: |
novops-build/novops
load_novops:
name: run Novops commands
runs-on: ubuntu-latest
needs: docker_build
steps:
- uses: actions/checkout@v3
- name: Download novops artifact
uses: actions/download-artifact@v3
with:
name: novops-binary
- name: novops load
run: |
chmod +x ./novops
./novops load -c tests/.novops.plain-strings.yml -s .envrc -e dev
cat .envrc >> "$GITHUB_ENV"
- name: check novops loaded values
run: env | grep MY_APP_HOST
- name: novops run and check var
run: |
./novops run -c tests/.novops.plain-strings.yml -e dev -- sh -c "env | grep DOG_PATH"