Skip to content

Commit

Permalink
feat(docs): lint changed docs files
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Oct 19, 2022
1 parent 4c7011d commit 068a719
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,61 @@ jobs:
shell: bash
run: cargo make check_contracts

check_docs_updated:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Installing jsonschema2md
run: npm install -g @adobe/jsonschema2md

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.64
default: true
override: true

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Generate schema
run: cargo make schema

- name: Generate documentations
run: cargo make generate_docs

- name: Verify changed docs files
uses: tj-actions/verify-changed-files@v12
id: verify-changed-docs-files
with:
files: |
docs
- name: Run step only when files change.
if: steps.verify-changed-docs-files.outputs.files_changed == 'true'
run: |
echo "❌ Documentation files has been updated."
echo " Changed files : ${{ steps.verify-changed-files.outputs.changed_files }}"
echo "Please generate docs using `cargo make generate_docs` then commit this new documentation."
exit 1
lint-branch-name:
runs-on: ubuntu-22.04
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
Expand Down

0 comments on commit 068a719

Please sign in to comment.