Migrate zig compiler #1119
This file contains hidden or 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 | |
| # Do not add permissions here! Configure them at the job level! | |
| permissions: {} | |
| jobs: | |
| build-and-test-native: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-15] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| - uses: roc-lang/setup-roc@39c354a6a838a0089eea9068a0414f49b62c5c08 | |
| with: | |
| # Note: nightly hashes are not verified because they are updated regularly. | |
| version: nightly | |
| - run: roc version | |
| - name: Install dependencies (Ubuntu) | |
| if: startsWith(matrix.os, 'ubuntu-') | |
| run: | | |
| sudo apt install -y expect ncat ripgrep | |
| - name: Install dependencies (macOS) | |
| if: startsWith(matrix.os, 'macos-') | |
| run: | | |
| brew install expect # expect for testing | |
| brew install nmap # includes ncat, for tcp-client example | |
| brew install ripgrep # ripgrep for ci/check_all_exposed_funs_tested.roc | |
| - run: expect -v | |
| - name: Run all tests | |
| run: ROC=roc EXAMPLES_DIR=./examples/ ./ci/all_tests.sh | |
| - name: Install dependencies for musl build | |
| if: startsWith(matrix.os, 'ubuntu-') | |
| run: | | |
| sudo apt-get install -y musl-tools | |
| if [[ "${{ matrix.os }}" == *"-arm" ]]; then | |
| # TODO re-enable once TODO below is done: rustup target add aarch64-unknown-linux-musl | |
| echo "no-op" | |
| else | |
| rustup target add x86_64-unknown-linux-musl | |
| fi | |
| - name: Test building with musl target | |
| if: startsWith(matrix.os, 'ubuntu-') | |
| env: | |
| ROC: roc | |
| run: | | |
| if [[ "${{ matrix.os}}" == *"-arm" ]]; then | |
| # TODO debug this: CARGO_BUILD_TARGET=aarch64-unknown-linux-musl $ROC build.roc | |
| echo "no-op" | |
| else | |
| CARGO_BUILD_TARGET=x86_64-unknown-linux-musl $ROC build.roc | |
| fi | |
| - name: Test using musl build | |
| if: startsWith(matrix.os, 'ubuntu-') | |
| run: | | |
| # TODO remove `if` when above TODOs are done | |
| if [[ "${{ matrix.os }}" != *"-arm" ]]; then | |
| NO_BUILD=1 IS_MUSL=1 ROC=roc EXAMPLES_DIR=./examples/ ./ci/all_tests.sh | |
| fi |