Skip to content

Commit

Permalink
unify all actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Esgrove committed Mar 18, 2024
1 parent cf91671 commit ac53abd
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 42 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
name: Python black

# Run either when pushing directly to main/master or in a PR targeting main/master
on:
push:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/black.yml"
- "**.py"
pull_request:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/black.yml"
- "**.py"

# Cancel previous runs for PRs but not pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

# https://github.com/psf/black
jobs:
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Go build
name: Go

# Run either when pushing directly to main/master or in a PR targeting main/master
on:
push:
branches:
Expand All @@ -16,18 +15,26 @@ on:
- master
- main

# Cancel previous runs for PRs but not pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./go

steps:
- uses: actions/checkout@v4
- name: Check out repository
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
go-version: "1.22.x"
cache-dependency-path: go/go.sum

- name: Install dependencies
Expand All @@ -36,5 +43,5 @@ jobs:
- name: Build
run: go build -v ./...

- name: Test with the Go CLI
- name: Run tests
run: go test
9 changes: 5 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: Integration Tests

# Run either when pushing directly to main/master or in a PR targeting main/master
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

permissions:
id-token: write
contents: read

# Cancel previous runs for PRs but not pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Python isort

# Run either when pushing directly to main/master or in a PR targeting main/master
on:
push:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/isort.yml"
- "**.py"
pull_request:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/isort.yml"
- "**.py"

# Cancel previous runs for PRs but not pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

# https://github.com/marketplace/actions/python-isort
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python environment
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
name: Python pip

# Run either when pushing directly to main/master or in a PR targeting main/master
on:
push:
branches:
- master
- main
paths:
- "python/requirements.txt"
- ".github/workflows/pip.yml"
- "python/requirements.txt"
pull_request:
branches:
- master
- main
paths:
- "python/requirements.txt"
- ".github/workflows/pip.yml"
- "python/requirements.txt"

# Cancel previous runs for PRs but not pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true


# https://github.com/py-actions/py-dependency-install
jobs:
dependencies:
runs-on: ubuntu-latest
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@ on:
- master
- main
paths:
- "**.py"
- ".github/workflows/ruff.yml"
- "**.py"
pull_request:
branches:
- master
- main
paths:
- "**.py"
- ".github/workflows/ruff.yml"
- "**.py"

# Cancel previous runs for PRs but not pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

# https://github.com/chartboost/ruff-action
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python environment
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ env:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust

steps:
- name: Check out source repository
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Rust toolchain
Expand All @@ -55,17 +59,19 @@ jobs:
restore-keys: ${{ runner.os }}-cargo-

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

- name: Run tests
working-directory: rust
run: cargo test --no-fail-fast

lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust

steps:
- name: Check out source repository
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Rust toolchain
Expand All @@ -88,9 +94,7 @@ jobs:
restore-keys: ${{ runner.os }}-cargo-

- name: Check formatting
working-directory: rust
run: cargo fmt --check --verbose

- name: Lint
working-directory: rust
run: cargo clippy -- -Dwarnings

0 comments on commit ac53abd

Please sign in to comment.