Skip to content

Commit

Permalink
[DEBUG]
Browse files Browse the repository at this point in the history
  • Loading branch information
Niols committed May 11, 2023
1 parent f23eb42 commit 67e348b
Showing 1 changed file with 4 additions and 146 deletions.
150 changes: 4 additions & 146 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,8 @@ jobs:
fail-fast: false
matrix:
include:
- {os: ubuntu, ocaml: 4.11.x} ## in Debian stable (2023-05-11)
- {os: ubuntu, ocaml: 4.11.x, lower-bounds: lower-bounds, doc: no-doc}
- {os: ubuntu, ocaml: 4.12.x}
- {os: ubuntu, ocaml: 4.13.x}
# {os: ubuntu, ocaml: 4.14.x} ## main supported version
- {os: ubuntu, ocaml: 4.14.x, lower-bounds: lower-bounds, doc: no-doc}
- {os: ubuntu, ocaml: 4.14.x, deploy-doc: deploy-doc}
- {os: ubuntu, ocaml: 4.14.1, bytecode: bytecode}
- {os: macos, ocaml: 4.14.x}
- {os: windows, ocaml: 4.14.x, tests: no-tests}
- {os: ubuntu, ocaml: 5.0.x}
## NOTE: The `ocaml/setup-ocaml@v2` action does not support `4.14.x`
## versions for `ocaml-variants` and such, hence the detailed version.
## NOTE: After OCaml 5.0.0, `ocaml-option-bytecode-only` can be used
## directly with `ocaml-base-compiler`, probably?
## NOTE: Tests are written in a Unix-like way and therefore cannot
## run correctly on Windows.
## NOTE: `lower-bounds` implies to not build the documentation because
## `opam-0install`, the solver we use, does not support it. Therefore
## we don't even install those dependencies to begin with.

## Grant GITHUB_TOKEN the permissions required to make a pages deployment
permissions:
Expand Down Expand Up @@ -121,9 +103,13 @@ jobs:
if: matrix.tests != 'no-tests'
run: opam exec -- make check

- run: which -a morbig || true

- name: Try installing
run: opam exec -- make install

- run: which -a morbig || true

- name: Try building examples
## NOTE: Examples are written in a Unix-like way and cannot build on a
## bytecode-only infrastructure.
Expand Down Expand Up @@ -201,131 +187,3 @@ jobs:

# - name: Try cleaning
# run: make clean

## ======================== [ Docker-based CI ] ======================== ##

docker-based:

strategy:
fail-fast: false
matrix:
include:
- {tag: alpine, deploy-image: deploy-image}
- {tag: archlinux}
- {tag: centos, tests: no-tests} ## only has Alcotest 1.6 (2023-05-11)
- {tag: debian}
- {tag: debian-testing}
- {tag: debian-unstable}
- {tag: fedora}
- {tag: opensuse}
- {tag: oraclelinux}
- {tag: ubuntu}
- {tag: ubuntu-lts}

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build Docker image
run: |
docker build \
--tag morbig \
. \
--build-arg tag=${{matrix.tag}} \
--build-arg doc=${{matrix.doc != 'no-doc'}} \
--build-arg tests=${{matrix.tests != 'no-tests'}}
- name: Run tests
run: |
docker run --entrypoint /bin/sh morbig -c '
set -e
eval $(opam env)
cd /home/opam/morbig
if ${{ matrix.tests != 'no-tests' }}; then
make check
fi
if ${{ matrix.doc != 'no-doc' }}; then
make doc
fi
make install
make examples
make uninstall
'
- name: Login to Docker Hub
if: github.event_name == 'push' && matrix.deploy-image == 'deploy-image'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Rename Docker image
if: github.event_name == 'push' && matrix.deploy-image == 'deploy-image'
run: docker image tag morbig colisanr/morbig:${GITHUB_REF##*/}

- name: Push to Docker Hub
if: github.event_name == 'push' && matrix.deploy-image == 'deploy-image'
run: docker push colisanr/morbig:${GITHUB_REF##*/}

## ========================= [ Nix-based CI ] ========================== ##

nix-based:

strategy:
fail-fast: false
matrix:
package:
- with-nixpkgs
- with-opam-nix

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Nix
uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
## Access token to avoid triggering GitHub's rate limiting.
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Install Nix dependencies
run: |
nix develop .#${{ matrix.package }} --print-build-logs --command true
- name: Build in development Shell
run: |
nix develop .#${{ matrix.package }} --command make
- name: Build documentation in development Shell
run: |
nix develop .#${{ matrix.package }} --command make doc
- name: Run tests in development Shell
run: |
nix develop .#${{ matrix.package }} --command make check
- name: Build with Nix
run: |
nix build .#${{ matrix.package }} --print-build-logs
nix-flake-checks:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Nix
uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
## Access token to avoid triggering GitHub's rate limiting.
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Run flake checks
run: nix flake check . --print-build-logs

0 comments on commit 67e348b

Please sign in to comment.