-
Notifications
You must be signed in to change notification settings - Fork 176
82 lines (69 loc) · 2.34 KB
/
bench.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
name: Benchmarks
on: [push]
jobs:
benchmarks:
name: benchmarks
runs-on: ubuntu-latest
container: fossa/haskell-static-alpine:ghc-9.4.7
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: actions/checkout@v3
with:
lfs: true
- name: Ensures git ownership check does not lead to compile error (we run git during compile for version tagging, etc.)
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# adduser cannot add users to group: https://unix.stackexchange.com/a/397733
# so we edit /etc/group directly
- name: Create nixbuild users/group
run: |
addgroup nixbld
adduser -D nixbld-1
adduser -D nixbld-2
adduser -D nixbld-3
sed 's/nixbld:x:\([[:digit:]]*\):$/nixbld:x:\1:nixbld-1,nixbld-2,nixbld-3/' /etc/group > group-changed
mv group-changed /etc/group
- name: run our custom nix install script
run : ./.github/scripts/install-nix.sh
shell: bash
env:
INPUT_NIX_PATH: "nixpkgs=channel:nixos-unstable"
INPUT_EXTRA_NIX_CONFIG: "build-users-group = nixbld"
INPUT_INSTALL_URL: ""
INPUT_INSTALL_OPTIONS: ""
- name: Debugging information
run: |
ghc --version || echo "no ghc"
cabal --version || echo "no cabal"
ghcup --version || echo "no ghcup"
rustc -V || echo "no rustc"
cargo -V || echo "no cargo"
- uses: Swatinem/rust-cache@v2
- uses: actions/cache@v3
name: Cache cabal store
with:
path: ${{ steps.setup-haskell.outputs.cabal-store || '~/.cache/cabal' }}
key: ${{ runner.os }}-benchmarks-cabal-cache-${{ hashFiles('**/*.cabal', 'cabal.project.ci.linux') }}
restore-keys: |
${{ runner.os }}-benchmarks-cabal-cache-
${{ runner.os }}-benchmarks-
${{ runner.os }}-
- name: Build Rust dependencies
run: cargo build --release
- name: Update vendored binaries
run: |
mkdir vendor-bins
./vendor_download.sh
env:
GITHUB_TOKEN: ${{ secrets.BASIS_ACCESS_TOKEN }}
- name: Build
env:
RUN_CMD: cabal build benchmarks
run: |
cabal update
$RUN_CMD || $RUN_CMD
- name: Bench
run: |
cabal bench --benchmark-options '+RTS -T'