@@ -12,10 +12,10 @@ permissions: {}
1212
1313jobs :
1414 build-and-test-native :
15- runs-on : ${{ matrix.operating-system }}
15+ runs-on : ${{ matrix.os }}
1616 strategy :
1717 matrix :
18- operating-system : [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm]
18+ os : [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-15 ]
1919 steps :
2020 - uses : actions/checkout@v4
2121
2626 run : |
2727 if [[ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]]; then
2828 curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_arm64-latest.tar.gz
29+ elif [[ "${{ runner.os }}" == "macOS" ]]; then
30+ curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_apple_silicon-latest.tar.gz
2931 else
3032 curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz
3133 fi
@@ -43,42 +45,50 @@ jobs:
4345
4446 - run : ./roc_nightly/roc version
4547
46- - run : |
47- sudo apt update
48- sudo apt install -y expect ncat valgrind ripgrep
49- # expect for testing
50- # ncat for tcp-client example
51- # ripgrep for ci/check_all_exposed_funs_tested.roc
48+ - name : Install dependencies (Ubuntu)
49+ if : startsWith(matrix.os, 'ubuntu-')
50+ run : |
51+ sudo apt install -y expect ncat ripgrep
52+
53+ - name : Install dependencies (macOS)
54+ if : startsWith(matrix.os, 'macos-')
55+ run : |
56+ brew install expect # expect for testing
57+ brew install nmap # includes ncat, for tcp-client example
58+ brew install ripgrep # ripgrep for ci/check_all_exposed_funs_tested.roc
5259
5360 - run : expect -v
5461
5562 - name : Run all tests
5663 run : ROC=./roc_nightly/roc EXAMPLES_DIR=./examples/ ./ci/all_tests.sh
5764
5865 - name : Install dependencies for musl build
66+ if : startsWith(matrix.os, 'ubuntu-')
5967 run : |
6068 sudo apt-get install -y musl-tools
61- if [[ "${{ matrix.operating-system }}" == *"-arm" ]]; then
69+ if [[ "${{ matrix.os }}" == *"-arm" ]]; then
6270 # TODO re-enable once TODO below is done: rustup target add aarch64-unknown-linux-musl
6371 echo "no-op"
6472 else
6573 rustup target add x86_64-unknown-linux-musl
6674 fi
6775
6876 - name : Test building with musl target
77+ if : startsWith(matrix.os, 'ubuntu-')
6978 env :
7079 ROC : ./roc_nightly/roc
7180 run : |
72- if [[ "${{ matrix.operating-system }}" == *"-arm" ]]; then
81+ if [[ "${{ matrix.os }}" == *"-arm" ]]; then
7382 # TODO debug this: CARGO_BUILD_TARGET=aarch64-unknown-linux-musl $ROC build.roc
7483 echo "no-op"
7584 else
7685 CARGO_BUILD_TARGET=x86_64-unknown-linux-musl $ROC build.roc
7786 fi
7887
7988 - name : Test using musl build
89+ if : startsWith(matrix.os, 'ubuntu-')
8090 run : |
8191 # TODO remove `if` when above TODOs are done
82- if [[ "${{ matrix.operating-system }}" != *"-arm" ]]; then
92+ if [[ "${{ matrix.os }}" != *"-arm" ]]; then
8393 NO_BUILD=1 IS_MUSL=1 ROC=./roc_nightly/roc EXAMPLES_DIR=./examples/ ./ci/all_tests.sh
8494 fi
0 commit comments