forked from ocaml-dune/dune-bin
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (64 loc) · 2.53 KB
/
test.yml
File metadata and controls
69 lines (64 loc) · 2.53 KB
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: test
on: [push, pull_request]
jobs:
test-make-tarball:
name: "Test that we can build the binary distro and package it as a tarball"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-13
name: x86_64-apple-darwin
output: .#dune.dynamic
- os: macos-14
name: aarch64-apple-darwin
output: .#dune.dynamic
- os: ubuntu-latest
name: x86_64-unknown-linux-musl
output: .#dune.static
steps:
- run: echo NAME=dune-${{ matrix.name }} >> $GITHUB_ENV
- uses: actions/checkout@v4
- if: matrix.os == 'ubuntu-latest'
name: "Install shells on ubuntu"
run: |
sudo apt-get update
sudo apt-get install -y zsh fish
- if: matrix.os != 'ubuntu-latest'
name: "Install shells on macos"
run: brew install fish
- uses: cachix/install-nix-action@v31
- name: "Build the binary distro and package it as a tarball"
run: ./make_tarball.sh $NAME ${{ matrix.output }}
- name: "Extract the tarball"
run: tar xf $NAME.tar.gz
- name: "Test that we can env scripts and the dune executable is in the expected place"
run: |
bash -c '. $NAME/share/dune/env/env.bash; __dune_env $PWD/$NAME; test $(which dune) = $PWD/$NAME/bin/dune'
zsh -c '. $NAME/share/dune/env/env.zsh; __dune_env $PWD/$NAME; test $(which dune) = $PWD/$NAME/bin/dune'
fish -c '. $NAME/share/dune/env/env.fish; __dune_env $PWD/$NAME; test $(which dune) = $PWD/$NAME/bin/dune'
sh -c '. $NAME/share/dune/env/env.sh; __dune_env $PWD/$NAME; test $(which dune) = $PWD/$NAME/bin/dune'
test-make-tarball-shellcheck:
name: "Run shellcheck on the build script"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install shellcheck"
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: "Run shellcheck on the build script"
run: shellcheck make_tarball.sh
test-env-script-shellcheck:
name: "Run shellcheck on the shell env script"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install shellcheck"
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: "Run shellcheck on the shell env script"
run: |
# exclude warning for sourcing missing external file
shellcheck extra/share/dune/env/env.sh extra/share/dune/env/env.bash