Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
arch: x86_64
runner: ubuntu-latest
version: nightly
- os: Linux
arch: x86_64
runner: ubuntu-latest
version: nightly-new-compiler
- os: Linux
arch: arm64
runner: ubuntu-24.04-arm
Expand All @@ -34,6 +38,10 @@ jobs:
arch: arm64
runner: ubuntu-24.04-arm
version: nightly
- os: Linux
arch: arm64
runner: ubuntu-24.04-arm
version: nightly-new-compiler
- os: macOS
arch: x86_64
runner: macos-15-intel
Expand All @@ -46,6 +54,10 @@ jobs:
arch: x86_64
runner: macos-15-intel
version: nightly
- os: macOS
arch: x86_64
runner: macos-15-intel
version: nightly-new-compiler
- os: macOS
arch: arm64
runner: macos-latest
Expand All @@ -58,6 +70,10 @@ jobs:
arch: arm64
runner: macos-latest
version: nightly
- os: macOS
arch: arm64
runner: macos-latest
version: nightly-new-compiler

steps:
- name: Checkout repository
Expand All @@ -71,8 +87,13 @@ jobs:
- name: Check Roc version
run: roc version

- name: Download HelloWorld example
- name: Download HelloWorld example (old compiler)
if: matrix.version != 'nightly-new-compiler'
run: curl -fsSL -o main.roc https://raw.githubusercontent.com/roc-lang/examples/main/examples/HelloWorld/main.roc

- name: Download HelloWorld example (new compiler)
if: matrix.version == 'nightly-new-compiler'
run: curl -fsSL -o main.roc https://raw.githubusercontent.com/roc-lang/nightlies/main/hello_world_test.roc

- name: Run HelloWorld example
run: roc main.roc
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ Add this step to your CI workflow:
version: nightly
```

### Using New Compiler Nightly Releases

```yaml
- uses: roc-lang/setup-roc@TODO
with:
# Installs the latest nightly from https://github.com/roc-lang/nightlies
version: nightly-new-compiler
```

## Platform Support

This action supports the following platforms:
Expand Down
19 changes: 16 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ branding:

inputs:
version:
description: 'Version of Roc to install (e.g., "nightly", "alpha4-rolling")'
description: 'Version of Roc to install (e.g., "nightly", "nightly-new-compiler", "alpha4-rolling")'
required: true

runs:
Expand Down Expand Up @@ -97,20 +97,33 @@ runs:
alpha4-rolling-macos_apple_silicon)
EXPECTED_SHA="416fbd983280eda11ac87b0947e27bf0a86d186a94baebeb71e163942bb5bd84"
;;
nightly-new-compiler-*)
# New compiler nightly builds - no SHA verification
;;
nightly-*)
# Nightly builds - no SHA verification
;;
*)
echo "Error: Unsupported version: $VERSION"
echo "Supported versions: nightly, alpha3-rolling, alpha4-rolling"
echo "Supported versions: nightly, nightly-new-compiler, alpha3-rolling, alpha4-rolling"
echo "Make sure your version is listed in https://github.com/roc-lang/roc/tags and try updating to"
echo "the latest commit of the setup-roc action, see <https://github.com/roc-lang/setup-roc>."
exit 1
;;
esac

# Download Roc
if [[ "$VERSION" == "nightly" ]]; then
if [[ "$VERSION" == "nightly-new-compiler" ]]; then
# Fetch the latest release from roc-lang/nightlies and find the asset for our platform
DOWNLOAD_URL=$(curl -fsSL "https://api.github.com/repos/roc-lang/nightlies/releases/latest" | \
jq -r ".assets[] | select(.name | contains(\"${PLATFORM}\")) | select(.name | endswith(\".tar.gz\")) | .browser_download_url")
if [[ -z "$DOWNLOAD_URL" ]]; then
echo "Error: Could not find a nightly-new-compiler release for platform: $PLATFORM"
exit 1
fi
SKIP_SHA_CHECK=true
DIR_PATTERN="roc_nightly-${PLATFORM}-*"
elif [[ "$VERSION" == "nightly" ]]; then
DOWNLOAD_URL="https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-${PLATFORM}-latest.tar.gz"
SKIP_SHA_CHECK=true
DIR_PATTERN="roc_nightly-${PLATFORM}-*"
Expand Down