Port updates from basic-webserver
& basic-ssg
upgrades, fix PR comments
#887
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
workflow_dispatch: | |
# this cancels workflows currently in progress if you start a new one | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-test-native: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ubuntu-20.04, ubuntu-22.04] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Does init() in platform/src/lib.rs contain all roc_fx functions? (Imperfect check) | |
run: cat platform/src/lib.rs | grep -oP 'roc_fx_[^(\s]*' | sort | uniq -u | grep -q . && exit 1 || exit 0 | |
- id: try_fetching_testing_release | |
continue-on-error: true | |
run: | | |
curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-TESTING.tar.gz | |
- name: There are no TESTING releases, checking regular releases instead | |
if: steps.try_fetching_testing_release.outcome == 'failure' | |
run: | | |
curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz | |
- name: rename nightly tar | |
run: mv $(ls | grep "roc_nightly.*tar\.gz") roc_nightly.tar.gz | |
- name: decompress the tar | |
run: tar -xzf roc_nightly.tar.gz | |
- run: rm roc_nightly.tar.gz | |
- name: simplify nightly folder name | |
run: mv roc_nightly* roc_nightly | |
- run: ./roc_nightly/roc version | |
- run: sudo apt install -y expect ncat valgrind | |
# expect for testing | |
# ncat for tcp-client example | |
- run: expect -v | |
- name: Run all tests | |
run: ROC=./roc_nightly/roc EXAMPLES_DIR=./examples/ ./ci/all_tests.sh | |
- name: Run all tests and capture output to check for crash later | |
run: ROC=./roc_nightly/roc EXAMPLES_DIR=./examples/ ./ci/all_tests.sh 2>&1 | tee all_tests_output.log | |
# Workaround for https://github.com/roc-lang/roc/issues/6688 | |
- name: Check if crash occurred | |
run: grep -zqv "crashed" all_tests_output.log | |
- name: Install dependencies for musl build | |
run: | | |
sudo apt-get install -y musl-tools | |
rustup target add x86_64-unknown-linux-musl | |
- name: Test building with musl target | |
run: ROC=./roc_nightly/roc CARGO_BUILD_TARGET=x86_64-unknown-linux-musl ./roc_nightly/roc build.roc | |
- name: Test using musl build | |
run: | | |
NO_BUILD=1 IS_MUSL=1 ROC=./roc_nightly/roc EXAMPLES_DIR=./examples/ ./ci/all_tests.sh |