Skip to content

Commit

Permalink
ci: run commitlint in basics action (#21)
Browse files Browse the repository at this point in the history
* ci: add commitlint in pre-commit and prefligit

* ci: use pull-request sha directly in basics action

* ci: run commitlint in basics action instead of pre-commit
  • Loading branch information
drink7036290 authored Dec 29, 2024
1 parent 4862f00 commit aa444c3
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
46 changes: 39 additions & 7 deletions .github/actions/basics/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:

# ===============================================

- name: Install Rust nightly
- name: install Rust nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ inputs.rust_nightly }}
Expand Down Expand Up @@ -59,7 +59,7 @@ runs:

# ===============================================

- name: Restore lychee cache
- name: restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
Expand All @@ -72,16 +72,20 @@ runs:

# ===============================================

- name: Run prefligit
- name: run prefligit
env:
GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha || '' }}
shell: bash
run: |
prefligit -v run --all-files
- uses: ./.github/actions/elapsed-time
with:
statement: "prefligit"
statement: "run prefligit"

- name: Run pre-commit
- name: run pre-commit
env:
GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha || '' }}
shell: bash
run: |
time python3 -m venv venv
Expand All @@ -91,11 +95,39 @@ runs:
- uses: ./.github/actions/elapsed-time
with:
statement: "pre-commit"
statement: "run pre-commit"

# ===============================================

- name: Show All Elapsed Times
- uses: actions/setup-node@v4
with:
node-version: "latest"

- uses: ./.github/actions/elapsed-time
with:
statement: "install Node.js"

- name: install commitlint
shell: bash
run: |
npm install @commitlint/{cli,config-conventional}
- uses: ./.github/actions/elapsed-time
with:
statement: "install commitlint"

- name: run commitlint
shell: bash
run: |
npx commitlint --last --verbose
- uses: ./.github/actions/elapsed-time
with:
statement: "run commitlint"

# ===============================================

- name: show All Elapsed Times
if: always()
shell: bash
run: |
Expand Down
7 changes: 6 additions & 1 deletion utilities/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ LIBCLANG_PATH=$clang_lib_dir cargo binstall --no-confirm cargo-spellcheck # --lo

wget https://github.com/drahnr/cargo-spellcheck/releases/download/v0.14.0/cargo-spellcheck-v0.14.0-x86_64-unknown-linux-gnu
chmod +x cargo-spellcheck-v0.14.0-x86_64-unknown-linux-gnu
mv cargo-spellcheck-v0.14.0-x86_64-unknown-linux-gnu cargo-spellcheck
mv cargo-spellcheck-v0.14.0-x86_64-unknown-linux-gnu cargo-spellcheck


# install commitlint
apt install -y nodejs npm
npm install --save-dev @commitlint/{cli,config-conventional}

0 comments on commit aa444c3

Please sign in to comment.