mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-15 21:23:10 +00:00
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
58 lines
1.7 KiB
YAML
58 lines
1.7 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@v6
|
|
- 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
|
|
strategy:
|
|
matrix:
|
|
workdir: ['./src/rust', './src/rust/lib_ccxr']
|
|
defaults:
|
|
run:
|
|
working-directory: ${{ matrix.workdir }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
${{ matrix.workdir }}/.cargo/registry
|
|
${{ matrix.workdir }}/.cargo/git
|
|
${{ matrix.workdir }}/target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('${{ matrix.workdir }}/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt, clippy
|
|
- name: dependencies
|
|
run: sudo apt update && sudo apt install libtesseract-dev libavformat-dev libavdevice-dev libswscale-dev yasm
|
|
- name: rustfmt
|
|
run: cargo fmt --all -- --check
|
|
- name: clippy
|
|
run: |
|
|
cargo clippy -- -D warnings
|