Skip to content

Commit 8656c78

Browse files
authored
Merge pull request #246 from roc-lang/setup-roc-action
try setup-roc action
2 parents e4d7403 + 6b490a6 commit 8656c78

File tree

2 files changed

+17
-69
lines changed

2 files changed

+17
-69
lines changed

.github/workflows/tests_alpha.yml

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,14 @@ jobs:
2121
timeout-minutes: 90
2222
steps:
2323
- uses: actions/checkout@v4
24-
25-
- name: Set OS-specific variables
26-
id: vars
27-
run: |
28-
if [[ "${{ matrix.operating-system }}" =~ ^ubuntu- ]]; then
29-
if [[ "${{ matrix.operating-system }}" =~ -arm$ ]]; then
30-
echo "os_pattern=linux_arm64" >> $GITHUB_OUTPUT
31-
else
32-
echo "os_pattern=linux_x86_64" >> $GITHUB_OUTPUT
33-
fi
34-
elif [ "${{ matrix.operating-system }}" = "macos-13" ]; then
35-
echo "os_pattern=macos_x86_64" >> $GITHUB_OUTPUT
36-
else
37-
echo "os_pattern=macos_apple_silicon" >> $GITHUB_OUTPUT
38-
fi
39-
40-
- name: Download alpha release
41-
run: |
42-
curl -fOL https://github.com/roc-lang/roc/releases/download/alpha4-rolling/roc-${{ steps.vars.outputs.os_pattern }}-alpha4-rolling.tar.gz
43-
44-
- name: rename alpha tar
45-
run: mv $(ls | grep "roc-.*tar\.gz") roc_alpha.tar.gz
46-
47-
- name: decompress the tar
48-
run: tar -xzf roc_alpha.tar.gz
49-
50-
- run: rm roc_alpha.tar.gz
51-
52-
- name: simplify nightly folder name
53-
run: mv roc_nightly* roc_alpha
54-
55-
- name: get short commit SHA
56-
run: echo "SHORT_COMMIT_SHA=$(./roc_alpha/roc version | grep -oP 'commit \K[a-f0-9]+' )" >> $GITHUB_ENV
57-
24+
25+
- uses: roc-lang/setup-roc@e2e4452c2bfb0380daadefdb23b989bc9748c63b
26+
with:
27+
version: alpha4-rolling
28+
29+
- name: Run Roc
30+
run: roc version
31+
5832
- name: Install dependencies (Ubuntu)
5933
if: startsWith(matrix.operating-system, 'ubuntu-')
6034
run: sudo apt install -y expect
@@ -66,9 +40,9 @@ jobs:
6640
brew install z3
6741
6842
- name: check if roc files are properly formatted
69-
run: ROC=./roc_alpha/roc ./ci_scripts/check_format.sh
43+
run: ROC=roc ./ci_scripts/check_format.sh
7044

71-
- run: ROC=./roc_alpha/roc ./ci_scripts/all_tests.sh
45+
- run: ROC=roc ./ci_scripts/all_tests.sh
7246

7347
- name: Checks if every folder in examples is mentioned in ./examples/index.md
7448
run: bash ./ci_scripts/check_index.sh

.github/workflows/tests_nightly.yml

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,12 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- name: Set OS-specific variables
26-
id: vars
27-
run: |
28-
if [[ "${{ matrix.operating-system }}" =~ ^ubuntu- ]]; then
29-
if [[ "${{ matrix.operating-system }}" =~ -arm$ ]]; then
30-
echo "os_pattern=linux_arm64" >> $GITHUB_OUTPUT
31-
else
32-
echo "os_pattern=linux_x86_64" >> $GITHUB_OUTPUT
33-
fi
34-
elif [ "${{ matrix.operating-system }}" = "macos-13" ]; then
35-
echo "os_pattern=macos_x86_64" >> $GITHUB_OUTPUT
36-
else
37-
echo "os_pattern=macos_apple_silicon" >> $GITHUB_OUTPUT
38-
fi
39-
40-
- name: Download latest nightly release
41-
run: |
42-
curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-${{ steps.vars.outputs.os_pattern }}-latest.tar.gz
43-
44-
- name: rename nightly tar
45-
run: mv $(ls | grep "roc_nightly.*tar\.gz") roc_nightly.tar.gz
46-
47-
- name: decompress the tar
48-
run: tar -xzf roc_nightly.tar.gz
49-
50-
- run: rm roc_nightly.tar.gz
51-
52-
- name: simplify nightly folder name
53-
run: mv roc_nightly* roc_nightly
25+
- uses: roc-lang/setup-roc@e2e4452c2bfb0380daadefdb23b989bc9748c63b
26+
with:
27+
version: nightly
5428

55-
- name: get short commit SHA
56-
run: echo "SHORT_COMMIT_SHA=$(./roc_nightly/roc version | grep -oP 'commit \K[a-f0-9]+' )" >> $GITHUB_ENV
29+
- name: Run Roc
30+
run: roc version
5731

5832
- name: Install dependencies (Ubuntu)
5933
if: startsWith(matrix.operating-system, 'ubuntu-')
@@ -66,9 +40,9 @@ jobs:
6640
brew install z3
6741
6842
- name: check if roc files are properly formatted
69-
run: ROC=./roc_nightly/roc ./ci_scripts/check_format.sh
43+
run: ROC=roc ./ci_scripts/check_format.sh
7044

71-
- run: ROC=./roc_nightly/roc ./ci_scripts/all_tests.sh
45+
- run: ROC=roc ./ci_scripts/all_tests.sh
7246

7347
- name: Checks if every folder in examples is mentioned in ./examples/index.md
7448
run: bash ./ci_scripts/check_index.sh

0 commit comments

Comments
 (0)