-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make format: Add auto indentation for C files, and a CI formatting wo…
…rkflow Also reformats all C files with these commands Signed-off-by: Andrii Sultanov <[email protected]>
- Loading branch information
1 parent
10156bc
commit bd2013b
Showing
11 changed files
with
657 additions
and
526 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Check format | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ocaml-format: | ||
name: Ocaml files | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Pull configuration from xs-opam | ||
run: | | ||
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env | ||
- name: Load environment file | ||
id: dotenv | ||
uses: falti/dotenv-action@v1 | ||
|
||
- name: Update Ubuntu repositories | ||
run: sudo apt-get update | ||
|
||
- name: Use ocaml | ||
uses: ocaml/setup-ocaml@v3 | ||
with: | ||
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }} | ||
opam-repositories: | | ||
xs-opam: ${{ steps.dotenv.outputs.repository }} | ||
dune-cache: true | ||
opam-pin: false | ||
|
||
- name: Install ocamlformat | ||
run: opam install ocamlformat | ||
|
||
- name: Check whether `make format` was run | ||
run: opam exec -- dune build @fmt | ||
|
||
- name: Check whether dune files are formatted | ||
run: opam exec -- dune format-dune-file dune-project > $$$$ && mv $$$$ dune-project |
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
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
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
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
Oops, something went wrong.