Add CI linting job #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://github.com/ocaml/setup-ocaml | |
# | |
name: ci | |
# The lints should be only run when packages are added | |
on: | |
pull_request: | |
paths: | |
- packages/ | |
push: | |
paths: | |
- packages/ | |
permissions: read-all | |
concurrency: | |
group: deploy-odoc | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout tree | |
uses: actions/checkout@v4 | |
- name: Install GNU prallel | |
run: sudo apt-get install -y parallel | |
- name: Set-up OCaml | |
uses: ocaml/setup-ocaml@v3 | |
with: | |
ocaml-compiler: 5 | |
- name: Install opam-ci-check | |
- run: opam pin opam-ci-check https://github.com/shonfeder/opam-repo-ci.git#411/archive-lint | |
# Get the names of the packages being added to the archive, and feed these | |
# to opam-ci-check | |
- name: Lint newly archived packages | |
- run: git diff --name-only main | sed 's:.*/\(.*\)/opam:\1:' | parallel opam exec -- opam-ci-check lint -r . --checks=archive-repo |