new workflow: build switch from json (#18) #2
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
name: build switch from json | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run-tests: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu, macos] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: facebook/install-dotslash@latest | |
- run: sudo apt-get install opam | |
if: matrix.os == 'ubuntu' | |
- run: brew install opam | |
if: matrix.os == 'macos' | |
- run: |- | |
opam init --color=always --compiler=5.1.1 --disable-sandboxing -y | |
opam env | sed -e "s/ export .*//g" -e "s/'//g" -e "s/\;//g" >> $GITHUB_ENV | |
- run: |- | |
mkdir -p third-party/ocaml | |
cat > switch.json <<EOF | |
{ | |
"name": "./third-party", | |
"compiler": "ocaml-variants", | |
"packages": [ | |
"ocamlfind" | |
] | |
} | |
EOF | |
python3 dromedary.py -o ./third-party/ocaml/BUCK.test switch.json | |
- run: echo "PATH=$(pwd):$PATH" >> $GITHUB_ENV | |
- run: |- | |
buck2 run root//test:version | |
cat $(buck2 build root//test:config --show-full-simple-output) |