diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bbe0109..d03b672 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,7 +4,7 @@ on: push: branches: [main] paths: - - 'Dockerfiles/ubuntu2204' + - "Dockerfiles/ubuntu2204" jobs: build-and-push-docker-image: @@ -29,7 +29,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get Current Date - run: echo "NOW=$(date +'%m%d%Y')" >> $GITHUB_ENV + run: echo "NOW=$(date +'%m%d%Y')" >> "$GITHUB_ENV" - name: Build image and push to Docker Hub uses: docker/build-push-action@v3 @@ -40,4 +40,4 @@ jobs: tags: | riscvintl/riscv-docs-base-container-image:${{ github.sha }} riscvintl/riscv-docs-base-container-image:latest - push: ${{ github.event_name != 'pull_request' }} \ No newline at end of file + push: ${{ github.event_name != 'pull_request' }} diff --git a/.github/workflows/on_pr.yaml b/.github/workflows/on_pr.yaml index 314b908..d299978 100644 --- a/.github/workflows/on_pr.yaml +++ b/.github/workflows/on_pr.yaml @@ -5,7 +5,7 @@ on: types: [opened, reopened, edited] branches: [main] paths: - - 'Dockerfiles/ubuntu2204' + - "Dockerfiles/ubuntu2204" jobs: build-and-run-image: @@ -27,4 +27,4 @@ jobs: with: context: . file: ./Dockerfiles/ubuntu2204 - platforms: linux/amd64,linux/arm64 \ No newline at end of file + platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..74b9ec3 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,15 @@ +--- +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/weekly_build.yaml b/.github/workflows/weekly_build.yaml index 92f5738..deef4eb 100644 --- a/.github/workflows/weekly_build.yaml +++ b/.github/workflows/weekly_build.yaml @@ -3,7 +3,7 @@ name: Weekly Build and Release on: schedule: # This will run every week at 00:00 UTC on Monday - - cron: '0 0 * * 1' + - cron: "0 0 * * 1" workflow_dispatch: jobs: @@ -30,7 +30,7 @@ jobs: - name: Get the current date id: current_date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + run: echo "name=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - name: Build image and push to Docker Hub uses: docker/build-push-action@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3e5d27d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-symlinks + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.2.5 + hooks: + - id: prettier + + - repo: https://github.com/rhysd/actionlint + rev: v1.6.27 + hooks: + - id: actionlint diff --git a/README.md b/README.md index 304b3be..46ae1b4 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ docker run -it -v $(pwd)/riscv-isa-manual:/build riscvintl/riscv-docs-base-conta The build artifacts will be located within the `riscv-isa-manual` in the `build` directory, for instance: ``` -$ ls ./riscv-isa-manual/build/ +$ ls ./riscv-isa-manual/build/ . |-- Makefile |-- riscv-privileged.aux @@ -121,4 +121,5 @@ docker run -it -v $(pwd)/riscv-isa-manual:/build riscvintl/riscv-docs-base-conta cd ./build make ``` + Once done, you can exit from the container with `exit` or leave it running and get back to the host with `ctrl p + ctrl q`. The build artifacts will be located within the `riscv-isa-manual`, in the `build` directory as shown in the previous step.