Skip to content

Commit 6a1d473

Browse files
authored
Merge pull request #210 from nerc-project/ci-cd_upgrade
CI CD upgrade
2 parents eceeb72 + 8dc1050 commit 6a1d473

File tree

119 files changed

+4115
-3551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+4115
-3551
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,67 @@ name: Build and Deploy Documentation using MkDocs
33
# Controls when the action will run. Triggers the workflow on push events on main branch
44
# but pull request events on any branch but deployement happens only for the main branch
55
on:
6-
push:
7-
branches:
8-
- main
9-
pull_request:
10-
# branches: [main]
6+
push:
7+
branches: [main]
8+
pull_request:
9+
# branches: [main]
1110

12-
# Allows you to run this workflow manually from the Actions tab
13-
workflow_dispatch:
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# permissions:
15+
# contents: read
1416

1517
jobs:
16-
build:
17-
name: Build Documentation
18-
runs-on: ubuntu-latest
19-
strategy:
20-
matrix:
21-
python-version: [3.8]
18+
build:
19+
name: Build Documentation
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
python-version: [3.10.12]
2224

23-
steps:
24-
- name: Checkout Main
25-
uses: actions/checkout@v2
25+
steps:
26+
- name: Checkout Main
27+
uses: actions/checkout@v4
2628

27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: ${{ matrix.python-version }}
31-
architecture: x64
32-
- name: Install dependencies and setup git config
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install -r requirements.txt
36-
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
37-
- name: Clean Build
38-
run: |
39-
mkdocs build --clean
40-
deploy:
41-
name: Deploy Documentation
42-
needs: build
43-
runs-on: ubuntu-latest
44-
strategy:
45-
matrix:
46-
python-version: [3.8]
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install dependencies and setup git config
34+
run: |
35+
python -m pip install --upgrade pip
36+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
37+
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
38+
- name: Clean Build
39+
run: |
40+
mkdocs build --clean
41+
deploy:
42+
name: Deploy Documentation
43+
needs: build
44+
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
python-version: [3.10.12]
4748

48-
# this part will only run if the PR has been merged
49-
# if: github.event.pull_request.merged == true
50-
# this part will only run if the branch or tag ref
51-
# that triggered the workflow is main i.e. pushed or PR merged in main
52-
if: github.ref == 'refs/heads/main'
53-
steps:
54-
- name: Checkout Main
55-
uses: actions/checkout@v2
49+
# this part will only run if the PR has been merged
50+
# if: github.event.pull_request.merged == true
51+
# this part will only run if the branch or tag ref
52+
# that triggered the workflow is main i.e. pushed or PR merged in main
53+
if: github.ref == 'refs/heads/main'
54+
steps:
55+
- name: Checkout Main
56+
uses: actions/checkout@v4
5657

57-
- name: Set up Python ${{ matrix.python-version }}
58-
uses: actions/setup-python@v2
59-
with:
60-
python-version: ${{ matrix.python-version }}
61-
architecture: x64
62-
- name: Install dependencies and setup git config
63-
run: |
64-
python -m pip install --upgrade pip
65-
pip install -r requirements.txt
66-
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
67-
- name: Deploy
68-
run: |
69-
mkdocs gh-deploy --force
58+
- name: Set up Python ${{ matrix.python-version }}
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: ${{ matrix.python-version }}
62+
- name: Install dependencies and setup git config
63+
run: |
64+
python -m pip install --upgrade pip
65+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
66+
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
67+
- name: Deploy
68+
run: |
69+
mkdocs gh-deploy --force

.github/workflows/precommit.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
name: Run pre-commit checks
22

33
on:
4-
push:
5-
pull_request:
4+
push:
5+
pull_request:
66

77
jobs:
8-
run-linters:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Check out code
12-
uses: actions/checkout@v2
8+
run-linters:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v4
1313

14-
- name: Setup Python
15-
uses: actions/setup-python@v2
16-
with:
17-
python-version: '^3.9'
14+
- name: Setup Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: ^3.10
1818

19-
- name: Configure caching
20-
uses: actions/cache@v2
21-
with:
22-
path: ~/.cache/pre-commit
23-
key: precommit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
19+
- name: Configure caching
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.cache/pre-commit
23+
key: precommit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
2424

25-
- name: Install requirements
26-
run: |
27-
pip install -r test-requirements.txt
25+
- name: Install requirements
26+
run: |
27+
pip install -r test-requirements.txt
2828
29-
- name: Run linters
30-
run: |
31-
pre-commit run --all-files
29+
- name: Run linters
30+
run: |
31+
pre-commit run --all-files

.gitignore

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/.vscode
2-
.idea/
1+
# JetBrains IDEs
2+
/.idea/
33

4-
.DS_Store
4+
# Python
5+
*.pyc
56
**/__pycache__/
67

78
# Environments
@@ -11,5 +12,21 @@ env/
1112
venv/
1213
ENV/
1314

15+
# Visual Studio Code
16+
.vscode/
17+
.history/
18+
*.code-workspace
19+
*.vsix
20+
21+
# Vim
22+
*.swp
23+
*.swo
24+
1425
# mkdocs documentation
1526
/site
27+
28+
# Others
29+
.DS_Store
30+
31+
# Node
32+
node_modules/

.markdown-link-check.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"aliveStatusCodes": [200, 206, 403],
3+
"ignorePatterns": [
4+
{
5+
"pattern": "^https://www\\.autosar\\.org/*"
6+
},
7+
{
8+
"pattern": "^http://localhost"
9+
},
10+
{
11+
"pattern": "^http://127\\.0\\.0\\.1"
12+
},
13+
{
14+
"pattern": "^https://github.com/.*/discussions/new"
15+
}
16+
],
17+
"retryOn429": true,
18+
"retryCount": 10
19+
}

.markdownlint.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.markdownlint.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules.
2+
default: true
3+
MD013:
4+
code_blocks: false
5+
tables: false
6+
headings: false
7+
MD029:
8+
style: ordered
9+
MD030: false
10+
MD033: false
11+
MD041: false
12+
MD046: false
13+
MD049: false

.pre-commit-config-optional.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/tcort/markdown-link-check
3+
rev: v3.12.2
4+
hooks:
5+
- id: markdown-link-check
6+
args: [--quiet, --config=.markdown-link-check.json]

.pre-commit-config.yaml

Lines changed: 72 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,73 @@
1-
---
1+
ci:
2+
autofix_commit_msg: "style(pre-commit): autofix"
3+
autoupdate_commit_msg: "ci(pre-commit): autoupdate"
4+
25
repos:
3-
- repo: https://github.com/Lucas-C/pre-commit-hooks
4-
rev: v1.1.10
5-
hooks:
6-
- id: remove-tabs
7-
8-
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v4.0.1
10-
hooks:
11-
- id: trailing-whitespace
12-
- id: check-merge-conflict
13-
- id: end-of-file-fixer
14-
- id: check-added-large-files
15-
- id: check-case-conflict
16-
- id: check-json
17-
- id: check-yaml
18-
args:
19-
- '--allow-multiple-documents'
20-
- id: check-symlinks
21-
- id: detect-private-key
22-
23-
- repo: https://github.com/adrienverge/yamllint.git
24-
rev: v1.26.3
25-
hooks:
26-
- id: yamllint
27-
files: \.(yaml|yml)$
28-
types: [file, yaml]
29-
entry: yamllint --strict
30-
31-
- repo: https://github.com/igorshubovych/markdownlint-cli
32-
rev: v0.29.0
33-
hooks:
34-
- id: markdownlint
35-
36-
- repo: https://github.com/Yelp/detect-secrets
37-
rev: v1.1.0
38-
hooks:
39-
- id: detect-secrets
40-
args: ['--baseline', '.secrets.baseline']
41-
exclude: .*/tests/.*
42-
43-
- repo: https://github.com/pycqa/flake8
44-
rev: '4.0.1'
45-
hooks:
46-
- id: flake8
47-
args:
48-
# these are errors that will be ignored by flake8
49-
# check out their meaning here
50-
# https://flake8.pycqa.org/en/latest/user/error-codes.html
51-
- '--ignore=E501,F401'
52-
exclude: ^testing/(data|examples)/
6+
- repo: https://github.com/Lucas-C/pre-commit-hooks
7+
rev: v1.5.5
8+
hooks:
9+
- id: forbid-crlf
10+
- id: remove-crlf
11+
- id: forbid-tabs
12+
- id: remove-tabs
13+
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.6.0
16+
hooks:
17+
- id: trailing-whitespace
18+
args: [--markdown-linebreak-ext=md]
19+
- id: check-merge-conflict
20+
- id: end-of-file-fixer
21+
- id: mixed-line-ending
22+
- id: check-added-large-files
23+
- id: check-case-conflict
24+
- id: check-json
25+
- id: check-yaml
26+
args: [--unsafe, --allow-multiple-documents]
27+
- id: check-symlinks
28+
- id: detect-private-key
29+
30+
- repo: https://github.com/adrienverge/yamllint
31+
rev: v1.35.1
32+
hooks:
33+
- id: yamllint
34+
files: \.(yaml|yml)$
35+
types: [file, yaml]
36+
entry: yamllint --strict
37+
exclude: .*.param.yaml
38+
39+
- repo: https://github.com/igorshubovych/markdownlint-cli
40+
rev: v0.41.0
41+
hooks:
42+
- id: markdownlint
43+
args: [-c, .markdownlint.yaml, --fix]
44+
45+
- repo: https://github.com/pre-commit/mirrors-prettier
46+
rev: v4.0.0-alpha.8
47+
hooks:
48+
- id: prettier
49+
args:
50+
- --ignore-path
51+
- .prettierignore
52+
- --config
53+
- .prettierrc.yaml
54+
55+
- repo: https://github.com/Yelp/detect-secrets
56+
rev: v1.5.0
57+
hooks:
58+
- id: detect-secrets
59+
args: [--baseline, .secrets.baseline]
60+
exclude: .*/tests/.*
61+
62+
- repo: https://github.com/pycqa/flake8
63+
rev: 7.1.1
64+
hooks:
65+
- id: flake8
66+
args:
67+
# these are errors that will be ignored by flake8
68+
# check out their meaning here
69+
# https://flake8.pycqa.org/en/latest/user/error-codes.html
70+
- --ignore=E501,F401
71+
exclude: ^testing/(data|examples)/
72+
73+
exclude: .svg

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.param.yaml

.prettierrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
printWidth: 100
2+
tabWidth: 4

0 commit comments

Comments
 (0)