Skip to content

Commit d43f2ab

Browse files
authored
Merge branch 'main' into nix-flake-cleanup
Signed-off-by: Anton-4 <[email protected]>
2 parents 4591a03 + 610fe89 commit d43f2ab

File tree

3 files changed

+107
-44
lines changed

3 files changed

+107
-44
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
on:
2+
# pull_request:
3+
# workflow_dispatch:
4+
5+
name: Test latest alpha releases for macOS and Linux
6+
7+
jobs:
8+
test-alpha:
9+
name: test alpha macos 13 (x64), macos 14 (aarch64), ubuntu 20.04-24.04 (x64), ubuntu 22.04-24.04 (aarch64)
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm]
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 90
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: goto-bus-stop/setup-zig@v2
19+
with:
20+
version: 0.13.0
21+
22+
- name: Delete everything except ci folder to test the release like a real user would
23+
run: find . -maxdepth 1 ! -name ci ! -name '.' -exec rm -rf {} +
24+
25+
- name: install z3 on macOS
26+
if: startsWith(matrix.os, 'macos')
27+
run: brew install z3
28+
29+
- name: get the latest release archive for linux (x86_64)
30+
if: startsWith(matrix.os, 'ubuntu') && !endsWith(matrix.os, '-arm')
31+
run: |
32+
curl -fL https://github.com/roc-lang/roc/releases/download/0.0.0-alpha2-rolling/roc-linux_x86_64-0-alpha2-rolling.tar.gz -o roc_release.tar.gz
33+
34+
- name: get the latest release archive for linux (arm64)
35+
if: startsWith(matrix.os, 'ubuntu') && endsWith(matrix.os, '-arm')
36+
run: |
37+
curl -fL https://github.com/roc-lang/roc/releases/download/0.0.0-alpha2-rolling/roc-linux_arm64-0-alpha2-rolling.tar.gz -o roc_release.tar.gz
38+
39+
- name: get the latest release archive for macos 13 (x86_64)
40+
if: matrix.os == 'macos-13'
41+
run: curl -fL https://github.com/roc-lang/roc/releases/download/0.0.0-alpha2-rolling/roc-macos_x86_64-0-alpha2-rolling.tar.gz -o roc_release.tar.gz
42+
43+
- name: get the latest release archive for macos 14 (aarch64)
44+
if: matrix.os == 'macos-14'
45+
run: curl -fL https://github.com/roc-lang/roc/releases/download/0.0.0-alpha2-rolling/roc-macos_apple_silicon-0-alpha2-rolling.tar.gz -o roc_release.tar.gz
46+
47+
- run: zig version
48+
49+
- name: prep and run basic tests
50+
run: |
51+
./ci/basic_release_test.sh roc_release.tar.gz
52+
53+
- name: test with old linux release (x86_64)
54+
if: startsWith(matrix.os, 'ubuntu') && !endsWith(matrix.os, '-arm')
55+
run: |
56+
curl -fL https://github.com/roc-lang/roc/releases/download/0.0.0-alpha2-rolling/roc-old_linux_x86_64-0-alpha2-rolling.tar.gz -o roc_release.tar.gz
57+
./ci/basic_release_test.sh roc_release.tar.gz
58+
59+
- name: test with old linux release (arm64)
60+
if: startsWith(matrix.os, 'ubuntu') && endsWith(matrix.os, '-arm')
61+
run: |
62+
curl -fL https://github.com/roc-lang/roc/releases/download/0.0.0-alpha2-rolling/roc-old_linux_arm64-0-alpha2-rolling.tar.gz -o roc_release.tar.gz
63+
./ci/basic_release_test.sh roc_release.tar.gz

.github/workflows/test_nightly_many_os.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
2-
workflow_dispatch:
3-
# pull_request:
2+
# pull_request:
3+
# workflow_dispatch:
44

55
name: Test latest nightly releases for macOS and Linux
66

@@ -26,11 +26,38 @@ jobs:
2626
if: startsWith(matrix.os, 'macos')
2727
run: brew install z3
2828

29+
- name: get the latest release archive for linux (x86_64)
30+
if: startsWith(matrix.os, 'ubuntu') && !endsWith(matrix.os, '-arm')
31+
run: |
32+
curl -fL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz -o roc_release.tar.gz
33+
34+
- name: get the latest release archive for linux (arm64)
35+
if: startsWith(matrix.os, 'ubuntu') && endsWith(matrix.os, '-arm')
36+
run: |
37+
curl -fL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_arm64-latest.tar.gz -o roc_release.tar.gz
38+
39+
- name: get the latest release archive for macos 13 (x86_64)
40+
if: matrix.os == 'macos-13'
41+
run: curl -fL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_x86_64-latest.tar.gz -o roc_release.tar.gz
42+
43+
- name: get the latest release archive for macos 14 (aarch64)
44+
if: matrix.os == 'macos-14'
45+
run: curl -fL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_apple_silicon-latest.tar.gz -o roc_release.tar.gz
46+
2947
- run: zig version
3048

31-
- name: Run basic tests
32-
run: ./ci/basic_release_test.sh ${{ matrix.os }}
49+
- name: prep and run basic tests
50+
run: |
51+
./ci/basic_release_test.sh roc_release.tar.gz
52+
53+
- name: test with old linux release (x86_64)
54+
if: startsWith(matrix.os, 'ubuntu') && !endsWith(matrix.os, '-arm')
55+
run: |
56+
curl -fL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-old_linux_x86_64-latest.tar.gz -o roc_release.tar.gz
57+
./ci/basic_release_test.sh roc_release.tar.gz
3358
34-
- name: Run basic tests with old release
35-
if: startsWith(matrix.os, 'ubuntu')
36-
run: ./ci/basic_release_test.sh ${{ matrix.os }} old
59+
- name: test with old linux release (arm64)
60+
if: startsWith(matrix.os, 'ubuntu') && endsWith(matrix.os, '-arm')
61+
run: |
62+
curl -fL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-old_linux_arm64-latest.tar.gz -o roc_release.tar.gz
63+
./ci/basic_release_test.sh roc_release.tar.gz

ci/basic_release_test.sh

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,26 @@
44
set -euxo pipefail
55

66
# Check if argument is provided
7-
if [ $# -lt 1 ]; then
8-
echo "Usage: $0 <os> [old]"
7+
if [ $# -ne 1 ]; then
8+
echo "Usage: $0 <tar-file>"
99
exit 1
1010
fi
1111

12-
OS="$1"
13-
IS_OLD="${2:-}"
12+
RELEASE_TAR_FILE="$1"
1413

15-
function download_release() {
16-
local os="$1"
17-
local is_old="$2"
18-
local old_prefix=""
19-
20-
if [ "$is_old" = "old" ]; then
21-
old_prefix="old_"
22-
fi
23-
24-
case "$os" in
25-
"macos-13")
26-
curl -fL "https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_x86_64-latest.tar.gz" -o roc_release.tar.gz
27-
;;
28-
"macos-14")
29-
curl -fL "https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_apple_silicon-latest.tar.gz" -o roc_release.tar.gz
30-
;;
31-
ubuntu-*-arm)
32-
curl -fL "https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-${old_prefix}linux_arm64-latest.tar.gz" -o roc_release.tar.gz
33-
;;
34-
ubuntu-*)
35-
curl -fL "https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-${old_prefix}linux_x86_64-latest.tar.gz" -o roc_release.tar.gz
36-
;;
37-
*)
38-
echo "Unsupported OS: $os"
39-
exit 1
40-
;;
41-
esac
42-
}
43-
44-
# Download the appropriate release
45-
download_release "$OS" "$IS_OLD"
14+
# Check if tar file exists
15+
if [ ! -f "$RELEASE_TAR_FILE" ]; then
16+
echo "Error: Tar file '$RELEASE_TAR_FILE' not found"
17+
exit 1
18+
fi
4619

4720
mkdir -p roc_release
4821

4922
# decompress the tar
50-
tar -xzvf roc_release.tar.gz -C roc_release
23+
tar -xzvf "$RELEASE_TAR_FILE" -C roc_release
5124

5225
# delete tar
53-
rm -rf roc_release.tar.gz
26+
rm -rf "$RELEASE_TAR_FILE"
5427

5528
cd roc_release/*/
5629

0 commit comments

Comments
 (0)