Skip to content

Commit

Permalink
Merge pull request #5672 from roc-lang/test-old-linux-release
Browse files Browse the repository at this point in the history
test old linux nightly
  • Loading branch information
Anton-4 committed Jul 22, 2023
2 parents 8d2bcf7 + c2eecb7 commit dca5526
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 46 deletions.
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
- 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 ..

0 comments on commit dca5526

Please sign in to comment.