From eba32f04d3c3a594b6280599b120dddad771c970 Mon Sep 17 00:00:00 2001 From: Kakadu Date: Tue, 30 Jul 2024 15:38:45 +0300 Subject: [PATCH] Adding OCaml 5.2 to CI Signed-off-by: Kakadu --- .github/workflows/master.yml | 79 +++++++++++++++++++--------------- .github/workflows/master52.yml | 64 +++++++++++++++++++++++++++ GT.opam | 6 ++- Makefile | 7 +++ README.md | 15 ++++--- dune-project | 7 ++- 6 files changed, 134 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/master52.yml diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index ce4aae41..931c744a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -1,9 +1,9 @@ name: Build master in docker on: - pull_request: - branches: - - 'master' + # pull_request: + # branches: + # - 'master' push: branches: - 'master' @@ -22,64 +22,75 @@ jobs: matrix: os: - ubuntu-latest - + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true runs-on: ${{ matrix.os }} container: image: ocaml/opam:ubuntu-lts-ocaml-4.14 - options: --user root # dirty hack + options: --user root # Kind of important dirty hack + #options: --user opam # dirty hack steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 1 - - run: sudo apt update + - run: | + sudo apt-get update + sudo apt-get install pkg-config libpcre2-dev m4 -y - run: opam --version - - run: | + - name: bisect many not work without it + run: | git config --global --add safe.directory /__w/GT/GT - git submodule update --init - - run: opam pin add GT . --no-action - - run: opam depext GT --yes #--with-test + #git submodule update --init + - name: Install dependecies for documentation run: | sudo apt-get install pkg-config libpcre2-dev -y - #opam install odoc pa_ppx --yes --depext - opam install odoc pa_ppx --yes - - run: opam install . --deps-only #--with-test - - run: opam exec -- dune build --profile=release - - run: opam exec -- dune test --profile=release + - run: opam install . --deps-only --with-test --with-doc + - run: opam exec -- dune build @check --profile=release + - run: opam exec -- dune test --profile=release - - name: Build documentation - run: opam exec -- dune build -p GT @doc + - name: Send coverage report to Coveralls + run: | + opam exec -- make coverage + opam exec -- bisect-ppx-report send-to Coveralls --coverage-path $BISECT_DIR + env: + BISECT_DIR: /tmp/GTcov + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PULL_REQUEST_NUMBER: ${{ github.event.number }} - name: Installing using Opam run: | opam exec -- dune build @install opam exec -- dune install - - name: List files - run: opam show --list-files GT - - name: Deploy documentation - if: ${{ github.event.pull_request.head.repo.full_name == 'PLTools/OCanren' }} + #if: ${{ github.event.pull_request.head.repo.full_name == 'PLTools/OCanren' }} + if: false uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_build/default/_doc/_html - - name: Send coverage report to Coveralls + - name: Build API documentation + if: github.event_name != 'pull_request' run: | - #git config --global --add safe.directory /__w/zanuda/zanuda - opam exec -- make coverage - opam exec -- bisect-ppx-report send-to Coveralls --coverage-path $BISECT_DIR - env: - BISECT_DIR: /tmp/GTcov - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULL_REQUEST_NUMBER: ${{ github.event.number }} + opam exec -- make install odig + echo "ODIG_DOC_LOC=$(opam exec -- odig cache path)/html" >> $GITHUB_ENV + + - name: Deploy documentation + #if: ${{ github.event.pull_request.head.repo.full_name == 'PLTools/GT' }} + #if: false + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ${{ env.ODIG_DOC_LOC }} + + - name: List files + run: opam show --list-files GT diff --git a/.github/workflows/master52.yml b/.github/workflows/master52.yml new file mode 100644 index 00000000..9a44f1ea --- /dev/null +++ b/.github/workflows/master52.yml @@ -0,0 +1,64 @@ +name: Build master in docker (OCaml 5.2) + +on: + push: + branches: + - 'master' + paths-ignore: + - 'README.md' + +env: + OPAMROOT: /home/opam/.opam + OPAMCONFIRMLEVEL: unsafe-yes + GT_WITH_DOCS: yes + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + runs-on: ${{ matrix.os }} + container: + image: ocaml/opam:ubuntu-lts-ocaml-5.2 + options: --user root # Kind of important dirty hack + #options: --user opam # dirty hack + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - run: | + sudo apt-get update + sudo apt-get install pkg-config libpcre2-dev m4 -y + - run: opam --version + + - name: bisect many not work without it + if: false #we will not run coverage in 5.2 + run: | + git config --global --add safe.directory /__w/GT/GT + #git submodule update --init + + + - name: Install dependecies for documentation + run: | + sudo apt-get install pkg-config libpcre2-dev -y + + - run: opam install . --deps-only --with-test --with-doc + - run: opam exec -- dune build @check --profile=release + - run: opam exec -- dune test --profile=release + + - name: Installing using Opam + run: | + opam exec -- dune build @install + opam exec -- dune install + + - name: List files + run: opam show --list-files GT diff --git a/GT.opam b/GT.opam index bd7c2774..243bdab2 100644 --- a/GT.opam +++ b/GT.opam @@ -26,13 +26,15 @@ depends: [ "ocaml" {>= "4.13" & < "5.0.0" | >= "5.2.0" & < "5.3.0"} "camlp5" {>= "8.00.05"} "dune" {>= "2.8"} + "ocamlgraph" + "ppx_inline_test" "ocamlfind" {build} "logger-p5" {build} "bisect_ppx" {build} "conf-m4" {build} - "ocamlgraph" - "ppx_inline_test" "odoc" {with-doc} + "odig" {with-doc} + "pa_ppx" {with-doc} ] build: [ ["dune" "subst"] {dev} diff --git a/Makefile b/Makefile index 1e2d802d..101123d3 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,13 @@ uninstall: dune build @install $(DFLAGS) dune uninstall $(DFLAGS) +.PHONY: odig +ODIG_SWITCHES = --odoc-theme=odig.gruvbox.light +ODIG_SWITCHES += --no-tag-index +ODIG_SWITCHES += --no-pkg-deps +odig: + odig odoc $(ODIG_SWITCHES) GT + .PHONY: coverage TEST_COV_D ?= /tmp/GTcov coverage: diff --git a/README.md b/README.md index ff7d8548..24ec1479 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ -| Branch master | -| ------------------------------- | -| [![GT][1]][2] | - -[1]: https://github.com/JetBrains-Research/GT/actions/workflows/master.yml/badge.svg?branch=master -[2]: https://github.com/JetBrains-Research/GT/actions/workflows/master.yml +[![GT][1]][2] +[![GT][3]][4] +[License](https://img.shields.io/badge/license-LGPL-blue) +[![API docs](https://img.shields.io/badge/Documentation-API-yellowgreen)](https://PLTools.github.io/GT/GT) + +[1]: https://github.com/PLTools/GT/actions/workflows/master.yml/badge.svg?branch=master +[2]: https://github.com/PLTools/GT/actions/workflows/master.yml +[3]: https://github.com/PLTools/GT/actions/workflows/master52.yml/badge.svg?branch=master +[4]: https://github.com/PLTools/GT/actions/workflows/master52.yml [![Coverage Status](https://coveralls.io/repos/github/PLTools/GT/badge.svg?branch=master)](https://coveralls.io/github/PLTools/GT?branch=master) diff --git a/dune-project b/dune-project index 7e423af6..3f29c8f5 100644 --- a/dune-project +++ b/dune-project @@ -37,12 +37,15 @@ (camlp5 (>= "8.00.05")) dune + ocamlgraph + ppx_inline_test (ocamlfind :build) (logger-p5 :build) (bisect_ppx :build) (conf-m4 :build) - ocamlgraph - ppx_inline_test + (odoc :with-doc) + (odig :with-doc) + (pa_ppx :with-doc) ; ))