improve shell.nix #675
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
| name: build-fedora | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:latest | |
| options: --user root | |
| steps: | |
| - name: test | |
| run: | | |
| set -x | |
| # GitHub sucks | |
| export HOME=/root | |
| cd $HOME | |
| # Install basic dependencies | |
| dnf update -y | |
| dnf install -y ca-certificates sed gzip grep git wget tar xz opam lld llvm | |
| git clone https://github.com/${{ github.repository }}.git | |
| cd $(basename ${{ github.repository }}) | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} | |
| git checkout pr-${{ github.event.pull_request.number }} | |
| else | |
| git checkout ${{ github.ref_name }} | |
| fi | |
| # Prepare OCaml stuff | |
| opam init --disable-sandboxing --bare -ya | |
| opam switch create ocaml ocaml-base-compiler --criteria="-notuptodate" | |
| eval "$(opam env)" | |
| export OPAMCONFIRMLEVEL=unsafe-yes | |
| opam update | |
| # Install system and opam-repo dependencies | |
| opam install . --depext-only --with-test | |
| opam install . --deps-only --with-test | |
| # Rustup | |
| # TODO: it seems there is a rust-std-static-wasm32-unknown-unknown package now, maybe we could replace rustup and use it instead? | |
| rustup target add wasm32-unknown-unknown | |
| # Build and test | |
| dune build @install | |
| dune build @quicktest |