diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4f10f8a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: ocaml/opam2:debian-stable - environment: - TERM: xterm - steps: - - checkout - - run: - name: Install system deps - command: | - sudo apt install m4 -y -qq - - restore_cache: - key: cache-{{ checksum "junit.opam" }}-{{ checksum "junit_alcotest.opam" }}-{{ checksum "junit_ounit.opam" }} - - run: - name: Update opam package list - command: opam update - - run: - name: 'Install deps' - command: opam install . --deps-only - - save_cache: - key: cache-{{ checksum "junit.opam" }}-{{ checksum "junit_alcotest.opam" }}-{{ checksum "junit_ounit.opam" }} - paths: - - ~/.opam - - run: - name: Build - command: opam pin add -y . - - run: - name: Test - command: eval `opam config env` && make test - - run: - name: Collect xml reports - command: | - mkdir -p ~/reports - cp _build/default/junit/test/simple.xml ~/reports - cp _build/default/alcotest/test/alcotest_report.xml ~/reports - - store_test_results: - path: ~/reports - - store_artifacts: - path: ~/reports diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d490940..a19a2fb 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -2,7 +2,6 @@ name: Build and Test on: - push - - pull_request jobs: build-and-test: @@ -15,7 +14,7 @@ jobs: # - windows-latest ocaml-version: - 4.14 - - 5.1 + - 5.2 runs-on: ${{ matrix.os }} @@ -24,11 +23,10 @@ jobs: uses: actions/checkout@v4 - name: Use OCaml ${{ matrix.ocaml-version }} - uses: ocaml/setup-ocaml@v2 + uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-version }} dune-cache: true - opam-depext-flags: "--with-test" allow-prerelease-opam: true - run: opam install . --deps-only --with-test @@ -38,3 +36,13 @@ jobs: - name: run test run: opam exec -- dune runtest + + - name: junit report + uses: dorny/test-reporter@v1 + if: success() || failure() # run this step even if previous step failed + with: + name: Test Report + path: "_build/default/alcotest/test/*.xml,_build/default/junit/test/*.xml" + reporter: java-junit + fail-on-error: false # Report results but don't fail the build + fail-on-empty: true # Use an empty test report to detect when something failed with the test runner diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cc34b59..29e281f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,16 +11,50 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use OCaml 5.1 - uses: ocaml/setup-ocaml@v2 + - name: Use OCaml 5.2 + uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: 5.1 + ocaml-compiler: 5.2 dune-cache: true - opam-depext-flags: "--with-doc" allow-prerelease-opam: true - name: Lint fmt - uses: ocaml/setup-ocaml/lint-fmt@v2 + uses: ocaml/setup-ocaml/lint-fmt@v3 + + # auto fix formatting, Thanks to robur.coop for the implementation + # https://discuss.ocaml.org/t/ocamlformat-and-github-actions/15464 + # lint-auto-fmt: + # runs-on: ubuntu-latest + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - name: Use OCaml 5.2 + # uses: ocaml/setup-ocaml@v3 + # with: + # ocaml-compiler: 5.2 + # dune-cache: true + # allow-prerelease-opam: true + + # - name: Install ocamlformat + # run: grep '^version' .ocamlformat | cut -d '=' -f 2 | xargs -I V opam install ocamlformat=V + + # - name: Format code + # run: | + # git ls-files '*.ml' '*.mli' | xargs opam exec -- ocamlformat --inplace + + # - name: Check for modified files + # id: git-check + # run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT + + # - name: Commit and push changes + # if: ${{ steps.git-check.outputs.modified == 'true' }} + # run: | + # git config --global user.name "Automated ocamlformat GitHub action, developed by robur.coop" + # git config --global user.email "autoformat@robur.coop" + # git add -A + # git commit -m "formatted code" + # git push lint-opam: runs-on: ubuntu-latest @@ -28,16 +62,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use OCaml 5.1 - uses: ocaml/setup-ocaml@v2 + - name: Use OCaml 5.2 + uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: 5.1 + ocaml-compiler: 5.2 dune-cache: true - opam-depext-flags: "--with-doc" allow-prerelease-opam: true - name: Lint opam - uses: ocaml/setup-ocaml/lint-opam@v2 + uses: ocaml/setup-ocaml/lint-opam@v3 lint-doc: runs-on: ubuntu-latest @@ -45,13 +78,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use OCaml 5.1 - uses: ocaml/setup-ocaml@v2 + - name: Use OCaml 5.2 + uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: 5.1 + ocaml-compiler: 5.2 dune-cache: true - opam-depext-flags: "--with-doc" allow-prerelease-opam: true - name: Lint doc - uses: ocaml/setup-ocaml/lint-doc@v2 + uses: ocaml/setup-ocaml/lint-doc@v3 diff --git a/.github/workflows/opam-dependency-submission.yml b/.github/workflows/opam-dependency-submission.yml index 72b1bec..be607d3 100644 --- a/.github/workflows/opam-dependency-submission.yml +++ b/.github/workflows/opam-dependency-submission.yml @@ -11,12 +11,12 @@ jobs: - name: Checkout tree uses: actions/checkout@v4 - - name: Set-up OCaml 5.1 - uses: ocaml/setup-ocaml@v2 + - name: Set-up OCaml 5.2 + uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: 5.1 + ocaml-compiler: 5.2 dune-cache: true allow-prerelease-opam: true - name: Opam Dependency Submission - uses: ocaml/setup-ocaml/analysis@v2 + uses: ocaml/setup-ocaml/analysis@v3