-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70bc0fe
commit 141820a
Showing
6 changed files
with
59 additions
and
38 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
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,57 @@ | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
name: Lint commits | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
# each new commit to a PR runs this workflow | ||
# so we need to avoid a long running older one from overwriting the 'pr-<number>-latest' | ||
group: "${{ github.workflow }} @ ${{ github.ref_name }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-commits: | ||
name: Lint commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 | ||
with: | ||
# we cannot use the actual merge as it is not a real commit yet | ||
# so we get the tip of the PR | ||
# and we protect ourselves from other changes by enforcing | ||
# the branch to be up to date with main before merging | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Set up toolchain | ||
shell: bash | ||
run: | | ||
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none --profile minimal -y | ||
# invoking this actually sets up the toolchain as per rust-toolchain.toml | ||
cargo --version | ||
- name: Cache dependencies | ||
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed | ||
env: | ||
CACHE_NAME: cargo-cache-dependencies | ||
with: | ||
path: | | ||
~/.cargo | ||
./target | ||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ hashFiles('Cargo.lock') }}-cargococogitto | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ hashFiles('Cargo.lock') }}- | ||
${{ runner.os }}-build-${{ env.CACHE_NAME }}- | ||
- name: Install cocogitto for commit linting | ||
run: | | ||
cargo install --locked cocogitto; | ||
- name: Check the commits | ||
shell: bash | ||
run: | | ||
cog check |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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