-
Notifications
You must be signed in to change notification settings - Fork 2
134 lines (106 loc) · 4.5 KB
/
main.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
defaults:
run:
shell: bash # Implies `set -eo pipefail`, among other things. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
env:
CI: 1
jobs:
build-x86_64-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v24
with:
install_url: https://releases.nixos.org/nix/nix-2.8.1/install
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
substituters = https://cache.nixos.org https://mzabani.cachix.org https://cache.iog.io
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= mzabani.cachix.org-1:wnkKakfl+rbT7zTtV1P1tAtjBTuh6GQVX7LfSd9sMbA= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- uses: cachix/cachix-action@v12
with:
name: mzabani
skipPush: false
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
# Wish this could be done, but there's a permissions problem. See https://github.com/actions/cache/issues/133
# - name: Nix Store Caching
# uses: actions/cache@v2
# with:
# path: /nix/
# key: ${{ runner.os }}-build
- name: Build statically linked codd
run: |
mkdir -p results
nix build -o results/linux-x86_64-codd ".#x86_64-unknown-linux-musl:codd:exe:codd"
- name: Build statically linked codd with aeson 1
run: nix build --no-link .#flakeAeson1.x86_64-linux.codd-musl
- name: Build statically linked codd's tests
run: nix build --no-link ".#x86_64-unknown-linux-musl:codd:test:codd-test"
- name: Build statically linked benchmarks
run: nix build --no-link ".#x86_64-unknown-linux-musl:codd:bench:codd-bench"
- name: Build executable used for installer
run: nix-build --no-out-link ./nix/install-codd-nixpkgs.nix -A codd
- name: Install codd with nix-env and uninstall it
run: |
nix-env -f ./nix/install-codd-nixpkgs.nix -iA codd
codd --help
nix-env --uninstall codd
- name: Run tests
run: nix develop .#shellWithRunfile.x86_64-linux -c run ci-tests
- name: Run benchmarks
run: nix run ".#x86_64-unknown-linux-musl:codd:bench:codd-bench"
- name: Build codd's library's haddocks
run: nix build --no-link ".#x86_64-unknown-linux-musl:codd:lib:codd.doc"
- name: Build codd's docker image
run: nix build -o results/docker-img-codd .#dockerImage.x86_64-linux
- uses: actions/upload-artifact@v3
with:
name: results/linux-x86_64-linux
path: results/linux-x86_64-linux
- uses: actions/upload-artifact@v3
with:
name: results/docker-img-codd
path: results/docker-img-codd
build-x86_64-macos:
# This job's purpose is to check the installer works for macos and push to cachix, but nothing else
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v24
with:
install_url: https://releases.nixos.org/nix/nix-2.8.1/install
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
substituters = https://cache.nixos.org https://mzabani.cachix.org https://cache.iog.io
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= mzabani.cachix.org-1:wnkKakfl+rbT7zTtV1P1tAtjBTuh6GQVX7LfSd9sMbA= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- uses: cachix/cachix-action@v12
with:
name: mzabani
skipPush: false
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
- name: Build executable used for installer
run: |
mkdir -p results
nix-build -o results/macos-x86_64-codd ./nix/install-codd-nixpkgs.nix -A codd
- name: Install codd with nix-env and uninstall it
run: |
nix-env -f ./nix/install-codd-nixpkgs.nix -iA codd
codd --help
nix-env --uninstall codd
- uses: actions/upload-artifact@v3
with:
name: results/macos-x86_64-codd
path: results/macos-x86_64-codd