Skip to content

Commit

Permalink
run formatting checks only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Esgrove committed Jan 12, 2024
1 parent c23885e commit b9ea497
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/black.yml"

# https://github.com/psf/black
jobs:
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
- master
- main

env:
CARGO_TERM_COLOR: always

# https://github.com/actions-rs/cargo
jobs:
cargo:
Expand All @@ -30,17 +33,29 @@ jobs:
with:
workspaces: ./rust -> target

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: build
working-directory: rust
run: cargo build

- name: fmt
working-directory: rust
# workaround for color output
env:
TERM: xterm-256color
run: cargo fmt --check --verbose

- name: clippy
working-directory: rust
env:
TERM: xterm-256color
# exit non-zero if there are any warnings
# https://doc.rust-lang.org/stable/clippy/usage.html
run: cargo clippy -- -Dwarnings
3 changes: 3 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ jobs:
with:
go-version: "1.21.x"
cache-dependency-path: go/go.sum

- name: Install dependencies
run: go get .

- name: Build
run: go build -v ./...

- name: Test with the Go CLI
run: go test
3 changes: 3 additions & 0 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/isort.yml"

# https://github.com/marketplace/actions/python-isort
jobs:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
branches:
- master
- main
paths:
- "python/requirements.txt"
- ".github/workflows/pip.yml"

# https://github.com/py-actions/py-dependency-install
jobs:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/ruff.yml"

# https://github.com/chartboost/ruff-action
jobs:
Expand Down

0 comments on commit b9ea497

Please sign in to comment.