Skip to content

Commit

Permalink
Try container-based CI (#106)
Browse files Browse the repository at this point in the history
* Try container-based CI

* Try fix CI

* Update README accordingly

* Update environment

* Use the correct name

* Fix permission issue

* Remove pre-done part from CI

* Update Dockerfile
  • Loading branch information
Ailrun authored Jun 7, 2024
1 parent b46d026 commit cc2ed3c
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM coqorg/coq:8.17.1
FROM coqorg/coq:8.17.1-ocaml-4.14.1-flambda

ENV NCPUS=4
ENV OPAMYES="true"
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/ci_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI build
on:
push:
branches:
- main
pull_request:
branches:
- main

env:
REGISTRY: "ghcr.io"
IMAGE_TAG: "beluga-lang/mcltt:main"

jobs:
wf:
name: Completeness of _CoqProject
runs-on: ubuntu-latest
steps:
- name: repo checkout
uses: actions/checkout@v3
- name: check
run: |
.github/scripts/check_projects.sh theories
build:
name: Continuous Intergration
runs-on: ubuntu-latest
permissions:
packages: read
steps:
- name: get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: repo checkout
uses: actions/checkout@v3

- name: container registry log in
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: image pre-pulling
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_TAG }}

- name: coq processing
uses: coq-community/docker-coq-action@v1
with:
custom_image: ${{ env.REGISTRY }}/${{ env.IMAGE_TAG }}
install: |
before_script: |
startGroup "Fix the permission issue"
sudo chown -R coq:coq .
endGroup
script: |
startGroup "Build Coq lib"
cd theories/
make -j ${{ steps.cpu-cores.outputs.count }} pretty-timed
endGroup
after_script: |
startGroup "Test parser"
dune build
dune runtest
endGroup
export: "OPAMJOBS OPAMYES"
env:
OPAMJOBS: ${{ steps.cpu-cores.outputs.count }}
OPAMYES: "true"

- name: permissions revert
# to avoid a warning at cleanup time
if: ${{ always() }}
run: sudo chown -R 1001:116 .
63 changes: 0 additions & 63 deletions .github/workflows/ci_build.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ implementation.

## Dependencies

* OCaml 4.14.0
* OCaml 4.14.1
* Menhir
* coq-menhirlib
* Coq 8.17.1
Expand All @@ -56,7 +56,7 @@ implementation.
We recommend to install dependencies in the following way:

```bash
opam switch create coq-8.17.1 4.14.0
opam switch create coq-8.17.1 4.14.1
opam install menhir
opam pin add coq 8.17.1
opam repo add coq-released https://coq.inria.fr/opam/released
Expand Down

0 comments on commit cc2ed3c

Please sign in to comment.