Skip to content

Convert tests to native github CI. #361

Convert tests to native github CI.

Convert tests to native github CI. #361

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
jobs:
cancel_previous_run:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
build_details:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.packages.outputs.packages }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Grab packages to build
id: packages
run: |
PACKAGES_TO_RUN=`OUTPUT_ONLY=true ./tests/run_tests.sh | while read i; do echo "\\\"$i\\\""; done | xargs | sed -e 's# #,#g' | tr -d '\n'`
echo "Packages to run: ${PACKAGES_TO_RUN}"
echo "packages=${PACKAGES_TO_RUN}]" >> "${GITHUB_OUTPUT}"
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.build_details.outputs.packages) }}
arch: [x64, x86]
ocaml_version: [4.14.1]
container:
image: ocamlcross/windows-${{ matrix.arch }}-base:${{ matrix.ocaml_version }}
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build package
env:
PKG_CONFIG_PATH: ${{ matrix.arch == 'x64' && '/usr/src/mxe/usr/x86_64-w64-mingw32.static/lib/pkgconfig/' || '/usr/src/mxe/usr/i686-w64-mingw32.static/lib/pkgconfig/' }}
run: |
rm -rf /home/opam/opam-cross-windows/packages /home/opam/opam-cross-windows/repo
mv packages /home/opam/opam-cross-windows
mv repo /home/opam/opam-cross-windows
sudo -u opam opam update
sudo -u opam opam list --short --recursive --external --vars os-distribution=mxe,os-family=mingw --required-by=${{ matrix.package }} > /home/opam/mxe-deps
cd /usr/src/mxe/ && cat /home/opam/mxe-deps | xargs make
eval $(sudo -u opam opam env)
opam reinstall --verbose -y ${{ matrix.package }}
VERBOSE=1 SYSTEM_TYPE=${{ matrix.arch }} ./tests/run_tests.sh