Skip to content

improve shell.nix

improve shell.nix #675

Workflow file for this run

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