From 2b278c062f73331bb3230e558ad0e9e750e61208 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 29 Jan 2024 11:36:28 -0800 Subject: [PATCH] Sync workflow with template repository again Now includes pre-commit instructions as well as a minor workflow update. --- .github/workflows/build-pdf.yml | 2 +- .github/workflows/pre-commit.yml | 4 ++-- readme.adoc | 28 ++++++++++++++++++++++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-pdf.yml b/.github/workflows/build-pdf.yml index d325c130..fe92f7e5 100644 --- a/.github/workflows/build-pdf.yml +++ b/.github/workflows/build-pdf.yml @@ -41,7 +41,7 @@ jobs: steps: # Checkout the repository - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 2126ca60..74b9ec35 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -10,6 +10,6 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - uses: pre-commit/action@v3.0.0 diff --git a/readme.adoc b/readme.adoc index b0ce9905..1018f0f0 100644 --- a/readme.adoc +++ b/readme.adoc @@ -31,7 +31,11 @@ git clone --recurse-submodules https://github.com/riscv/riscv-cheri.git === Building the Documentation -To start the build process, run `cd ./riscv-cheri && make all`. +To start the build process, run: + +```shell +cd ./riscv-cheri && make all +``` The link:Makefile[] script will check the availability of Docker on your system: @@ -44,4 +48,24 @@ The build process utilizes several options, including theming and font settings, === Cleaning up -To clean up the generated files, run `make clean`. This will remove the generated PDF file. +To clean up the generated files, run: + +```shell +make clean +``` + +This will remove the generated PDF file. + +== Enabling pre-commit checks locally +The repository has some basic commit checks set up with https://pre-commit.com/[pre-commit] that will be enforced by the GitHub CI. +To ensure these checks are also run in the local repository while making changes the following command can be run: +[source,shell] +---- +pip3 install pre-commit && pre-commit install +---- + +When enabling additional checks https://pre-commit.com/#plugins[by editing .pre-commit-config.yaml], it is recommended to run to newly added check on all files in the repository. This can be done with the following command: +[source,shell] +---- +pre-commit run --all-files +----