Stream: show and tell

Topic: Setup Roc GitHub Action


view this post on Zulip Hannes (Jan 13 2025 at 05:41):

Just wanted to let people know that I've updated the setup-roc GitHub action to include an option for testing releases, so if you have a branch that you want to use a testing release of Roc to test, then just upgrade to v0.4.0 add testing: "true" to the step. (The quotes are necessary because GitHub actions uses strings for options)

e.g.

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repository
        uses: actions/checkout@v4
      - name: Install Roc
        uses: hasnep/setup-roc@v0.4.0
        with:
          roc-version: nightly
          testing: "true"
      - name: Test the library
        run: roc test src/main.roc

view this post on Zulip Sam Mohr (Jan 13 2025 at 05:42):

That will definitely help with all of these upgrades we're doing!

view this post on Zulip Luke Boswell (Jan 24 2025 at 23:26):

I'm wondering if this should use testing if available otherwise fallback to nightly... the issue I think have with this setup is that I can't merge the branch into main (and make a release from the package/platform's main) until there is a nightly roc -- but we won't promote our TESTING roc to nightly until we know it works well with everything.

view this post on Zulip Luke Boswell (Jan 24 2025 at 23:26):

If I merge the branch into main, and it's still got testing: "true", as soon as the TESTING is removed and promoted to a nightly, now main no longer works.

view this post on Zulip Luke Boswell (Jan 24 2025 at 23:28):

Another bit of feedback @Hannes

I've tried using this with a matrix setup like so, but it doesn't download the correct URL for the nightly/testing for other operating system/archs. I think it's currently hardcoded to linux x64.

on:
  pull_request:
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build-and-test-native:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - operating-system: ubuntu-20.04
            roc-archive: roc_nightly-linux_x86_64-latest.tar.gz
            package-manager: apt
          - operating-system: ubuntu-22.04
            roc-archive: roc_nightly-linux_x86_64-latest.tar.gz
            package-manager: apt
          - operating-system: macos-13
            roc-archive: roc_nightly-macos_x86_64-latest.tar.gz
            package-manager: brew
          - operating-system: macos-14
            roc-archive: roc_nightly-macos_apple_silicon-latest.tar.gz
            package-manager: brew
    steps:
      - uses: actions/checkout@v4

      - name: Install Roc
        uses: hasnep/setup-roc@v0.4.0
        with:
          roc-version: nightly
          testing: "true"

      - name: Check roc version
        run: roc version

      - name: Run all tests
        run: ./ci/all_tests.sh

view this post on Zulip Luke Boswell (Jan 24 2025 at 23:50):

In the end I've gone with this setup... and I really like it. It's nice having the matrix running on more of our supported os/arch combinations (the free GH runner don't cover everything).

https://github.com/lukewilliamboswell/basic-ssg/blob/main/.github/workflows/tests.yaml

view this post on Zulip Hannes (Jan 25 2025 at 01:37):

Hmm thanks for that Luke, the testing option was supposed to just be a temporary thing because I don't expect the testing releases to last forever, I'll try setting up a whole matrix of OSs like you've got there and debugging it

view this post on Zulip Luke Boswell (Jan 25 2025 at 01:47):

The testing thing is really helpful for our core things we check for breaking changes. If it's possible to use it with a fallback or maybe have that configurable, it would help me.

Thanks for looking at this.

view this post on Zulip Hannes (Jan 25 2025 at 09:51):

v0.5.0 now has three options for the TESTING input, never is the default and will ignore testing versions, always will only get versions marked as testing and auto will try getting a testing version and if it fails, get a non-testing version instead. Thanks for the feedback @Luke Boswell and let me know if it works now :)

view this post on Zulip Luke Boswell (Jan 25 2025 at 10:00):

Thank you Hannes, will do

view this post on Zulip Hannes (Feb 03 2025 at 12:21):

With the release of the Roc v0.0.0 alphas, you can use an alpha release in a GitHub Actions workflow by changing the roc-version input from nightly to 0.0.0-alpha2-rolling, or use a matrix to run the CI against both the alpha and nightly versions, like this:

jobs:
  bundle:
    name: Bundle
    runs-on: ubuntu-latest
    strategy:
      matrix:
        roc-version:
          - 0.0.0-alpha2-rolling
          - nightly
    steps:
      - name: Check out the repository
        uses: actions/checkout@v4
      - name: Install Roc
        uses: hasnep/setup-roc@v0.5.0
        with:
          roc-version: ${{ matrix.roc-version }}
    ...

Last updated: Jul 06 2025 at 12:14 UTC