wipfixup cargo update #6
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
name: 'Commits Check' | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- reopened | |
- synchronize | |
pull_request_target: | |
types: | |
- opened | |
- edited | |
- reopened | |
- synchronize | |
push: | |
branches: | |
- '*' | |
jobs: | |
check-comventional-commits: | |
name: Check Conventional Commits | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: webiny/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
check-push-commits: | |
if: ${{ github.event_name == 'push' }} | |
strategy: | |
matrix: | |
commit: ${{ github.event.commits }} | |
name: "Check: ${{ matrix.commit.message }}" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Install dependencies Ubuntu" | |
run: | | |
sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential pkg-config | |
sudo apt-get install -y libleptonica-dev libtesseract-dev | |
- name: "Install rust-toolchain stable" | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain : stable | |
components: clippy, rustfmt | |
- name: "Show environment" | |
run: | | |
rustc -vV | |
cargo -vV | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check spelling of entire workspace | |
id: typos_check | |
if: $${{ always() }} | |
uses: crate-ci/typos@master | |
- name: "Cargo formatting" | |
id: cargo_fmt | |
if: $${{ always() }} | |
run: | | |
cargo fmt --all -- --check | |
- name: "Cargo doc" | |
id: cargo_doc | |
env: | |
RUSTDOCFLAGS: "-D warnings" | |
if: $${{ always() }} | |
run: cargo doc --locked | |
- name: "Cargo clippy" | |
id: cargo_clippy | |
if: $${{ always() }} | |
run: cargo clippy --profile=test --locked | |
- name: "Cargo test" | |
id: cargo_test | |
if: $${{ always() }} | |
run: cargo test --locked | |
- name: "Some checks failed" | |
if: ${{ failure() }} | |
run: | | |
echo "### :x: Checks Failed!" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "|Job|Status|" >> $GITHUB_STEP_SUMMARY | |
echo "|---|------|" >> $GITHUB_STEP_SUMMARY | |
echo "|typos|${{ steps.typos_check.outcome}}|" >> $GITHUB_STEP_SUMMARY | |
echo "|Cargo fmt|${{ steps.cargo_fmt.outcome }}|" >> $GITHUB_STEP_SUMMARY | |
echo "|Cargo readme|${{ steps.cargo_readme.outcome }}|" >> $GITHUB_STEP_SUMMARY | |
echo "|Cargo doc|${{ steps.cargo_doc.outcome }}|" >> $GITHUB_STEP_SUMMARY | |
echo "|Cargo clippy|${{ steps.cargo_clippy.outcome }}|" >> $GITHUB_STEP_SUMMARY | |
echo "|Cargo test|${{ steps.cargo_test.outcome }}|" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "Please check the failed jobs and fix where needed." >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
- name: "All checks passed" | |
if: ${{ success() }} | |
run: | | |
echo "### :white_check_mark: Checks Passed!" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY |