diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 7566856d52d..4d016a3e3cd 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: Benchmarks diff --git a/.github/workflows/macos_x86_64.yml b/.github/workflows/macos_x86_64.yml index 8d112a2a53e..fc3527fa292 100644 --- a/.github/workflows/macos_x86_64.yml +++ b/.github/workflows/macos_x86_64.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: Macos x86-64 rust tests diff --git a/.github/workflows/nix_linux_x86_64.yml b/.github/workflows/nix_linux_x86_64.yml index 90406b3ddf3..647adf6fa57 100644 --- a/.github/workflows/nix_linux_x86_64.yml +++ b/.github/workflows/nix_linux_x86_64.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: Nix linux x86_64 cargo test diff --git a/.github/workflows/nix_macos_apple_silicon.yml b/.github/workflows/nix_macos_apple_silicon.yml index d1d37969d4f..0f00277d2cd 100644 --- a/.github/workflows/nix_macos_apple_silicon.yml +++ b/.github/workflows/nix_macos_apple_silicon.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: Nix apple silicon cargo test diff --git a/.github/workflows/nix_macos_x86_64.yml b/.github/workflows/nix_macos_x86_64.yml index 53bd641fdc8..7c9e43aa281 100644 --- a/.github/workflows/nix_macos_x86_64.yml +++ b/.github/workflows/nix_macos_x86_64.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: Nix macOS x86_64 cargo test diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 5ad79a396f1..fb7f9284c0c 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: SpellCheck diff --git a/.github/workflows/test_nightly_many_os.yml b/.github/workflows/test_nightly_many_os.yml index 8885a9c1862..aeb25e52d6b 100644 --- a/.github/workflows/test_nightly_many_os.yml +++ b/.github/workflows/test_nightly_many_os.yml @@ -1,11 +1,9 @@ on: + #pull_request: workflow_dispatch: name: Test latest nightly release for macOS, ubu 20.04, ubu 22.04 x86_64 -env: - ZIG_VERSION: 0.9.1 - jobs: test-nightly: name: test nightly macos 11, macos 12, ubu 20.04, ubu 22.04 @@ -17,6 +15,9 @@ jobs: timeout-minutes: 90 steps: - uses: actions/checkout@v3 + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.9.1 - name: get the latest release archive for linux (x86_64) if: startsWith(matrix.os, 'ubuntu') @@ -26,44 +27,19 @@ jobs: if: startsWith(matrix.os, 'macos') run: curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_x86_64-latest.tar.gz - - name: remove everything in this dir except the tar # we want to test like a user who would have downloaded the release, so we clean up all files from the repo checkout - run: ls | grep -v "roc_nightly.*tar\.gz" | xargs rm -rf - - - name: decompress the tar - run: ls | grep "roc_nightly.*tar\.gz" | xargs tar -xzvf - - - name: delete tar - run: ls | grep "roc_nightly.*tar\.gz" | xargs rm -rf - - - name: rename nightly folder - run: mv roc_nightly* roc_nightly - - - name: test roc hello world - run: cd roc_nightly && ./roc examples/helloWorld.roc + - run: zig version - - name: test platform switching rust - run: cd roc_nightly && ./roc examples/platform-switching/rocLovesRust.roc + - name: prep and run basic tests + run: | + ./ci/basic_nightly_test.sh - - name: get OS to use for zig download + - name: clean up, get old linux release (x86_64), run tests if: startsWith(matrix.os, 'ubuntu') - run: echo "OS_TYPE=linux" >> $GITHUB_ENV - - - name: get OS to use for zig download - if: startsWith(matrix.os, 'macos') - run: echo "OS_TYPE=macos" >> $GITHUB_ENV - - - name: Install zig run: | - curl -fL -o zig.tar.xz https://ziglang.org/download/${ZIG_VERSION}/zig-${{env.OS_TYPE}}-x86_64-${ZIG_VERSION}.tar.xz && tar -xf zig.tar.xz - echo "${GITHUB_WORKSPACE}/zig-${{env.OS_TYPE}}-x86_64-${ZIG_VERSION}" >> $GITHUB_PATH - - name: zig version - run: zig version - - - name: test platform switching zig - run: cd roc_nightly && ./roc examples/platform-switching/rocLovesZig.roc + rm -rf roc_nightly + curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-old_linux_x86_64-latest.tar.gz + ./ci/basic_nightly_test.sh - - name: test platform switching c - run: cd roc_nightly && ./roc examples/platform-switching/rocLovesC.roc diff --git a/.github/workflows/ubuntu_x86_64.yml b/.github/workflows/ubuntu_x86_64.yml index fd7f81ddf0f..a411f73d120 100644 --- a/.github/workflows/ubuntu_x86_64.yml +++ b/.github/workflows/ubuntu_x86_64.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: CI @@ -61,7 +62,6 @@ jobs: run: ./ci/www-repl.sh && sccache --show-stats #TODO i386 (32-bit linux) cli tests - #TODO verify-no-git-changes - name: test website build script diff --git a/.github/workflows/windows_release_build.yml b/.github/workflows/windows_release_build.yml index a889900b0cf..28452089557 100644 --- a/.github/workflows/windows_release_build.yml +++ b/.github/workflows/windows_release_build.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: windows - release build diff --git a/.github/workflows/windows_tests.yml b/.github/workflows/windows_tests.yml index 2fe095b711b..3fce2a66cb1 100644 --- a/.github/workflows/windows_tests.yml +++ b/.github/workflows/windows_tests.yml @@ -1,4 +1,5 @@ -on: [pull_request] +on: + pull_request: name: windows - subset of tests diff --git a/ci/basic_nightly_test.sh b/ci/basic_nightly_test.sh new file mode 100755 index 00000000000..dca5da8ae03 --- /dev/null +++ b/ci/basic_nightly_test.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +set -euxo pipefail + +# if to prevent unset vars errror +if [ -n "$(ls | grep -v "roc_nightly.*tar\.gz" | grep -v "^ci$")" ]; then + + # Remove everything in this dir except the tar and ci folder. + # We want to test like a user who would have downloaded the release, so we clean up all files from the repo checkout. + to_delete=$(ls | grep -v "roc_nightly.*tar\.gz" | grep -v "^ci$") + + for file_or_dir in $to_delete + do + echo "Removing: $file_or_dir" + rm -rf "$file_or_dir" + done +fi + +# decompress the tar +ls | grep "roc_nightly.*tar\.gz" | xargs tar -xzvf + +# delete tar +ls | grep "roc_nightly.*tar\.gz" | xargs rm -rf + +# rename nightly folder +mv roc_nightly* roc_nightly + +cd roc_nightly + +# test roc hello world +./roc examples/helloWorld.roc + +./roc examples/platform-switching/rocLovesRust.roc + +./roc examples/platform-switching/rocLovesZig.roc + +./roc examples/platform-switching/rocLovesC.roc + +cd ..