-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): added pipeline linter for commit and rustlinter
Signed-off-by: rjtch <[email protected]>
- Loading branch information
Showing
5 changed files
with
79 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ name: linter | |
|
||
permissions: | ||
contents: read | ||
# To report GitHub Actions status checks | ||
statuses: write | ||
|
||
on: | ||
push: | ||
|
@@ -17,34 +19,55 @@ concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
lint_commits: | ||
name: Lint Commit Messages | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check Commit Lint | ||
uses: wagoid/[email protected] | ||
with: | ||
configFile: "./.commitlint.config.js" | ||
uses: wagoid/[email protected] | ||
|
||
lint_check: | ||
name: Rust - lint_${{ matrix.lint_projects }} | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
lint_projects: | ||
- cargo_fmt_check | ||
- cargo_toml_fmt_files | ||
- cargo_clippy | ||
- cargo_deny | ||
- cargo_toml_files | ||
steps: | ||
- name: Checkout repository | ||
- name: Run the checkout command | ||
uses: actions/checkout@v4 | ||
- name: Install rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
components: clippy, rustfmt | ||
- name: Install development tools | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-deny, dprint | ||
- name: Rust Cache | ||
uses: actions/cache@v4 | ||
continue-on-error: false | ||
with: | ||
path: | | ||
~/.cargo/bin | ||
~/.cargo/registry | ||
~/.cargo/git/db/ | ||
key: ${{ runner.os }}-sdk-rust-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-sdk-rust- | ||
- name: Check cargo version | ||
run: cargo --version | ||
- name: Run lint ${{ matrix.lint_projects }} | ||
run: make -f Makefile lint_${{ matrix.lint_projects }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
parserPreset: 'conventional-changelog-conventionalcommits', | ||
rules: { | ||
'body-leading-blank': [1, 'always'], | ||
'body-max-line-length': [2, 'always', 100], | ||
'footer-leading-blank': [1, 'always'], | ||
'footer-max-line-length': [2, 'always', 100], | ||
'header-max-length': [2, 'always', 100], | ||
'subject-case': [ | ||
2, | ||
'never', | ||
['sentence-case', 'start-case', 'pascal-case', 'upper-case'], | ||
], | ||
'subject-empty': [2, 'never'], | ||
'subject-full-stop': [2, 'never', '.'], | ||
'type-case': [2, 'always', 'lower-case'], | ||
'type-empty': [2, 'never'], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'build', | ||
'chore', | ||
'ci', | ||
'docs', | ||
'feat', | ||
'fix', | ||
'perf', | ||
'refactor', | ||
'revert', | ||
'style', | ||
'test', | ||
], | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters