Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add yaml related pre-commit hooks #295

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@
]
}
},
"forwardPorts": [
8000, 8080
]
"forwardPorts": [8000, 8080]
}
142 changes: 71 additions & 71 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy pages
on:
push:
branches:
- main
- main
workflow_dispatch:
permissions:
contents: read
Expand All @@ -18,73 +18,73 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Build manual
run: ./do gen:html_manual MANUAL_NAME=isa VERSIONS=all
- name: Build html documentation for generic_rv64
run: ./do gen:html[generic_rv64]
- name: Generate YARD docs
run: ./do gen:tool_doc
- name: Create _site/example_cfg
run: mkdir -p _site/example_cfg
- name: Create _site/manual
run: mkdir -p _site/manual
- name: Create _site/pdfs
run: mkdir -p _site/pdfs
- name: Create _site/htmls
run: mkdir -p _site/htmls
- name: Copy cfg html
run: cp -R gen/cfg_html_doc/generic_rv64/html _site/example_cfg
- name: Create RVA20 Profile Release PDF Spec
run: ./do gen:profile[RVA20]
- name: Copy RVA20 Profile Release PDF
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVA20.pdf
- name: Create RVA22 Profile Release PDF Spec
run: ./do gen:profile[RVA22]
- name: Copy RVA22 Profile Release PDF
run: cp gen/profile_doc/pdf/RVA22.pdf _site/pdfs/RVA22.pdf
- name: Create RVI20 Profile Release PDF Spec
run: ./do gen:profile[RVI20]
- name: Copy RVI20 Profile Release PDF
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVI20.pdf
- name: Create MC100 PDF Spec
run: ./do gen:cert_model_pdf[MC100]
- name: Copy MC100 PDF
run: cp gen/certificate_doc/pdf/MC100.pdf _site/pdfs/MC100.pdf
- name: Create MC100 HTML Spec
run: ./do gen:cert_model_html[MC100]
- name: Copy MC100 HTML
run: cp gen/certificate_doc/html/MC100.html _site/htmls/MC100.html
- name: Copy manual html
run: cp -R gen/manual/isa/top/all/html _site/manual
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Build manual
run: ./do gen:html_manual MANUAL_NAME=isa VERSIONS=all
- name: Build html documentation for generic_rv64
run: ./do gen:html[generic_rv64]
- name: Generate YARD docs
run: ./do gen:tool_doc
- name: Create _site/example_cfg
run: mkdir -p _site/example_cfg
- name: Create _site/manual
run: mkdir -p _site/manual
- name: Create _site/pdfs
run: mkdir -p _site/pdfs
- name: Create _site/htmls
run: mkdir -p _site/htmls
- name: Copy cfg html
run: cp -R gen/cfg_html_doc/generic_rv64/html _site/example_cfg
- name: Create RVA20 Profile Release PDF Spec
run: ./do gen:profile[RVA20]
- name: Copy RVA20 Profile Release PDF
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVA20.pdf
- name: Create RVA22 Profile Release PDF Spec
run: ./do gen:profile[RVA22]
- name: Copy RVA22 Profile Release PDF
run: cp gen/profile_doc/pdf/RVA22.pdf _site/pdfs/RVA22.pdf
- name: Create RVI20 Profile Release PDF Spec
run: ./do gen:profile[RVI20]
- name: Copy RVI20 Profile Release PDF
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVI20.pdf
- name: Create MC100 PDF Spec
run: ./do gen:cert_model_pdf[MC100]
- name: Copy MC100 PDF
run: cp gen/certificate_doc/pdf/MC100.pdf _site/pdfs/MC100.pdf
- name: Create MC100 HTML Spec
run: ./do gen:cert_model_html[MC100]
- name: Copy MC100 HTML
run: cp gen/certificate_doc/html/MC100.html _site/htmls/MC100.html
- name: Copy manual html
run: cp -R gen/manual/isa/top/all/html _site/manual
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "_site"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
52 changes: 26 additions & 26 deletions .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ name: Regression test
on:
pull_request:
branches:
- main
- main
workflow_dispatch:
jobs:
regress:
runs-on: ubuntu-latest
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Run regression
run: ./do regress
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Run regression
run: ./do regress
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
exclude: ^docs/ruby/

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-symlinks
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-json
exclude: ^\.devcontainer/ # Uses JSONC (comments)
- id: check-yaml

- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
files: \.(json|yml|yaml)$

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-jsonschema
alias: check-jsonschema-inst
files: ^arch/inst/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/inst_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-csr
files: ^arch/csr/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/csr_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-ext
files: ^arch/ext/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/ext_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-cert-model
files: ^arch/certificate_model/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/cert_model_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-cert-class
files: ^arch/certificate_class/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/cert_class_schema.json"]
# Commenting because throwing errors and not sure this is complete yet
# - id: check-jsonschema
# alias: check-jsonschema-manual-version
# files: ^arch/manual/.*\.(yaml|yml)$
# args: ["--schemafile", "schemas/manual_version_schema.json"]
18 changes: 9 additions & 9 deletions .solargraph.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
include:
- "lib/**/*.rb"
- "tasks/**/*.rake"
- "lib/**/*.rb"
- "tasks/**/*.rake"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".home/**/*"
- spec/**/*
- test/**/*
- vendor/**/*
- ".home/**/*"
require: []
domains: []
reporters:
- rubocop
- require_not_found
- rubocop
- require_not_found
formatter:
rubocop:
cops: safe
except: []
only: []
extra_args: []
require_paths:
- /usr/lib/ruby/3.2.0
- /usr/lib/ruby/3.2.0
plugins: []
max_files: 5000
6 changes: 3 additions & 3 deletions arch/certificate_class/MC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ naming_scheme: |

Where:

* Left & right square braces denote optional.
* Left & right square braces denote optional.
* \<model> is a 3 digit integer. It is changed only when mandatory extensions are added to a CRD.
** The one's digit is incremented when a small mandatory extension is added (e.g., Zicond)
** The ten's digit is incremented when a medium mandatory extension is addded (e.g., PMP)
** The hundreds's digit is incremented when a large mandatory extension is addded (e.g., V or H)
* \<version> is a semantic version (see semver.org) formatted as <major>[.<minor>.[patch]]. If \<version> is omitted, the reference applies equally to all versions.
* \<version> is a semantic version (see semver.org) formatted as <major>[.<minor>.[patch]]. If \<version> is omitted, the reference applies equally to all versions.
** A <major> release indicates support for a new optional extension.
** A <minor> release indicates one or more of the following changes to the certification tests associated with the CRD.
*** Fix test bug or increase test coverage
Expand All @@ -35,4 +35,4 @@ naming_scheme: |
** A <patch> release indicates just CRD specification changes without any difference in functional behavior

mandatory_priv_modes:
- M
- M
2 changes: 1 addition & 1 deletion arch/certificate_class/MockCertificateClass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ naming_scheme: |
A Mock certificate class or model can have any name as long as it can be a hash key.

mandatory_priv_modes:
- M
- M
Loading
Loading