Skip to content

Commit

Permalink
Merge branch 'main' into div-0-should-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazhafiz committed Dec 3, 2023
2 parents 298f93d + 6dddb7b commit 20bcd70
Show file tree
Hide file tree
Showing 195 changed files with 7,087 additions and 1,154 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: Benchmarks

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

env:
RUST_BACKTRACE: 1
ROC_NUM_WORKERS: 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci_cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * 1'

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci_cleanup_nix_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'

name: Clean up nix on mac mini m1

jobs:
clean-mac-mini-arm64:
runs-on: [self-hosted, macOS, ARM64]
timeout-minutes: 120
steps:
- name: Clean up nix store
run: nix-store --gc

- name: Clean up old nix shells
run: rm -rf /private/tmp/nix-shell.*
114 changes: 114 additions & 0 deletions .github/workflows/ci_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
on:
pull_request:

name: CI manager

# cancel current runs when a new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-changes:
runs-on: ubuntu-22.04
outputs:
run_tests: ${{ steps.filecheck.outputs.run_tests }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check if only css, html or md files changed
id: filecheck
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$)'; then
echo "run_tests=full" >> $GITHUB_OUTPUT
else
echo "run_tests=none" >> $GITHUB_OUTPUT
fi
- run: echo "debug output ${{ steps.filecheck.outputs.run_tests }}"

start-nix-linux-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_x86_64.yml

start-nix-linux-aarch64-build-default-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_default.yml

start-nix-linux-aarch64-cargo-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_cargo.yml

start-nix-macos-apple-silicon-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_macos_apple_silicon.yml

start-macos-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/ubuntu_x86_64.yml

start-ubuntu-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/ubuntu_x86_64.yml

start-windows-release-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_release_build.yml

start-windows-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_tests.yml

start-roc-benchmarks:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/benchmarks.yml

ran-full:
runs-on: ubuntu-22.04
needs: [
start-nix-linux-x86-64-tests,
start-nix-linux-aarch64-build-default-test,
start-nix-linux-aarch64-cargo-build-test,
start-nix-macos-apple-silicon-tests,
start-macos-x86-64-tests,
start-ubuntu-x86-64-tests,
start-windows-release-build-test,
start-windows-tests,
start-roc-benchmarks
]
steps:
- run: echo "all workflows succeeded!"

ran-none:
runs-on: ubuntu-22.04
needs: [check-changes]
if: needs.check-changes.outputs.run_tests == 'none'
steps:
- run: echo "Only non-code files changed. CI manager did not run any workflows."

# we need a single end job for the required checks under branch protection rules
finish:
runs-on: ubuntu-22.04
needs: [ran-full, ran-none]
if: |
always()
&& contains(needs.*.result, 'success')
&& !contains(needs.*.result, 'failure')
&& !contains(needs.*.result, 'cancelled')
&& !(needs.ran-full.result == 'skipped' && needs.ran-none.result == 'skipped')
steps:
- run: echo "Workflow succeeded :)"



6 changes: 3 additions & 3 deletions .github/workflows/devtools_test_linux_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
on:
pull_request:
pull_request:

name: devtools nix files test - linux

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

jobs:
devtools-test-linux:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/devtools_test_macos_apple_silicon.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
on:
pull_request:
pull_request:

name: devtools nix files test - macos

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

jobs:
devtools-test-macos:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/macos_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: Macos x86-64 rust tests

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/nix_linux_arm64_cargo.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: test cargo build on linux arm64 inside nix

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/nix_linux_arm64_default.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: test default.nix on linux arm64

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/nix_linux_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: Nix linux x86_64 cargo test

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/nix_macos_apple_silicon.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: Nix apple silicon cargo test

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/nix_macos_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: Nix macOS x86_64 cargo test

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/ubuntu_x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: CI

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/windows_release_build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: windows - release build

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

env:
RUST_BACKTRACE: 1

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/windows_tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
on:
pull_request:
workflow_call:

name: windows - subset of tests

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

env:
RUST_BACKTRACE: 1

Expand Down
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ install-zig-llvm:
RUN apt -y install libssl-dev
RUN OPENSSL_NO_VENDOR=1 cargo install wasm-pack
# sccache
RUN cargo install sccache
RUN cargo install sccache --locked
RUN sccache -V
ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache
ENV SCCACHE_DIR=/earthbuild/sccache_dir
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Work in progress!

Roc is not ready for a 0.1 release yet, but we do have:
[Roc](https://www.roc-lang.org) is not ready for a 0.1 release yet, but we do have:

- [**installation** guide](https://github.com/roc-lang/roc/tree/main/getting_started)
- [**tutorial**](https://roc-lang.org/tutorial)
Expand All @@ -17,18 +17,22 @@ You can 💜 **sponsor** 💜 Roc on:
- [GitHub](https://github.com/sponsors/roc-lang)
- [Liberapay](https://liberapay.com/roc_lang)

We are very grateful for our corporate sponsors [Vendr](https://www.vendr.com/), [RWX](https://www.rwx.com), and [Tweede golf](https://tweedegolf.nl/en):
We are very grateful for our corporate sponsors [Vendr](https://www.vendr.com/), [RWX](https://www.rwx.com), [Tweede golf](https://tweedegolf.nl/en), and [ohne-makler](https://www.ohne-makler.net):

[<img src="https://user-images.githubusercontent.com/1094080/223597445-81755626-a080-4299-a38c-3c92e7548489.png" height="60" alt="Vendr logo"/>](https://www.vendr.com)
&nbsp;&nbsp;&nbsp;&nbsp;
[<img src="https://github.com/roc-lang/roc/assets/1094080/82c0868e-d23f-42a0-ac2d-c6e6b2e16575" height="60" alt="RWX logo"/>](https://www.rwx.com)
&nbsp;&nbsp;&nbsp;&nbsp;
[<img src="https://user-images.githubusercontent.com/1094080/183123052-856815b1-8cc9-410a-83b0-589f03613188.svg" height="60" alt="tweede golf logo"/>](https://tweedegolf.nl/en)
[<img src="https://www.ohne-makler.net/static/img/brand/logo.svg" height="60" alt="ohne-makler logo"/>](https://www.ohne-makler.net)

If you would like your company to become a corporate sponsor of Roc's development, please [DM Richard Feldman on Zulip](https://roc.zulipchat.com/#narrow/pm-with/281383-user281383)!

We'd also like to express our gratitude to our generous [individual sponsors](https://github.com/sponsors/roc-lang/)! A special thanks to those sponsoring $25/month or more:

* [Drew Lazzeri](https://github.com/asteroidb612)
* [Alex Binaei](https://github.com/mrmizz)
* [Jono Mallanyk](https://github.com/jonomallanyk)
* [Chris Packett](https://github.com/chris-packett)
* [James Birtles](https://github.com/jamesbirtles)
* [Ivo Balbaert](https://github.com/Ivo-Balbaert)
Expand Down
4 changes: 2 additions & 2 deletions ci/build_basic_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ mv roc_nightly* roc_nightly
cd roc_nightly

# build the basic cli platform
./roc build ../basic-cli/examples/countdown.roc
./roc build ../basic-cli/examples/countdown.roc --optimize

# We need this extra variable so we can safely check if $2 is empty later
EXTRA_ARGS=${2:-}

# In some rare cases it's nice to be able to use the legacy linker, so we produce the .o file to be able to do that
if [ -n "${EXTRA_ARGS}" ];
then ./roc build $EXTRA_ARGS ../basic-cli/examples/countdown.roc
then ./roc build $EXTRA_ARGS ../basic-cli/examples/countdown.roc --optimize
fi

cd ..
4 changes: 2 additions & 2 deletions ci/build_basic_webserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ cd roc_nightly
# prevent https://github.com/roc-lang/basic-webserver/issues/9
if [ "$OS" != "Linux" ] || [ "$ARCH" != "x86_64" ]; then
# build the basic-webserver platform
./roc build ../basic-webserver/examples/echo.roc
./roc build ../basic-webserver/examples/echo.roc --optimize
fi

# We need this extra variable so we can safely check if $2 is empty later
EXTRA_ARGS=${2:-}

# In some rare cases it's nice to be able to use the legacy linker, so we produce the .o file to be able to do that
if [ -n "${EXTRA_ARGS}" ];
then ./roc build $EXTRA_ARGS ../basic-webserver/examples/echo.roc
then ./roc build $EXTRA_ARGS ../basic-webserver/examples/echo.roc --optimize
fi

cd ..
Loading

0 comments on commit 20bcd70

Please sign in to comment.