mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2025-01-13 05:31:14 +00:00
68e6390c76
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.4.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.4.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Format sourcecode
|
|
on:
|
|
push:
|
|
paths:
|
|
- '.github/workflows/format.yml'
|
|
- 'src/**.c'
|
|
- 'src/**.h'
|
|
- 'src/rust/**'
|
|
tags-ignore: # ignore push via new tag
|
|
- '*.*'
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
paths:
|
|
- '.github/workflows/format.yml'
|
|
- 'src/**.c'
|
|
- 'src/**.h'
|
|
- 'src/rust/**'
|
|
jobs:
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: Format code
|
|
run: |
|
|
find src/ -type f -not -path "src/thirdparty/*" -not -path "src/lib_ccx/zvbi/*" -name '*.c' -not -path "src/GUI/icon_data.c" | xargs clang-format -i
|
|
git diff-index --quiet HEAD -- || (git diff && exit 1)
|
|
format_rust:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./src/rust
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
src/rust/.cargo/registry
|
|
src/rust/.cargo/git
|
|
src/rust/target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt, clippy
|
|
- name: rustfmt
|
|
run: cargo fmt --all -- --check
|
|
- name: clippy
|
|
run: cargo clippy -- -D warnings
|