Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test old_linux nightly release too #5672

Merged
merged 17 commits into from
Jul 22, 2023
3 changes: 2 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: Benchmarks

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/macos_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: Macos x86-64 rust tests

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nix_linux_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: Nix linux x86_64 cargo test

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nix_macos_apple_silicon.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: Nix apple silicon cargo test

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nix_macos_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: Nix macOS x86_64 cargo test

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: SpellCheck

Expand Down
48 changes: 12 additions & 36 deletions .github/workflows/test_nightly_many_os.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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')
Expand All @@ -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
Comment on lines -29 to -42
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was moved to a bash script

- 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



4 changes: 2 additions & 2 deletions .github/workflows/ubuntu_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: CI

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows_release_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: windows - release build

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on: [pull_request]
on:
pull_request:

name: windows - subset of tests

Expand Down
40 changes: 40 additions & 0 deletions ci/basic_nightly_test.sh
Original file line number Diff line number Diff line change
@@ -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 ..
Loading