-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,33 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Check code style | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events | ||
[ push, pull_request ] | ||
push:w | ||
pull_request: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-codestyle | ||
cancel-in-progress: true | ||
|
||
# This workflow contains a single job called "style" | ||
jobs: | ||
style: | ||
|
||
# The type of runner that the job will run on | ||
name: Check code style | ||
runs-on: ubuntu-latest | ||
|
||
# A strategy creates a build matrix for your jobs | ||
strategy: | ||
|
||
# You can define a matrix of different job configurations | ||
matrix: | ||
|
||
# Each option you define in the matrix has a key and value | ||
python-version: [ 3.9 ] | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Set up Git repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
# Setup Python with version from matrix | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- name: Install rye | ||
uses: eifinger/setup-rye@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
enable-cache: true | ||
|
||
# Install requirements | ||
- name: Install requirements | ||
|
||
# Runs command-line programs using the operating system's shell | ||
run: | | ||
python -m pip install --upgrade pip wheel setuptools | ||
python -m pip install -r requirements.txt | ||
python -m pip list | ||
- name: Sync dependencies | ||
run: rye sync | ||
|
||
# Install pre-commit from .pre-commit-config.yaml | ||
- name: Install pre-commit | ||
run: | | ||
pre-commit install | ||
rye run -- pre-commit install | ||
# Run pre-commit on all the files in the repo | ||
- name: Run pre-commit | ||
run: | | ||
pre-commit run --all-files --color always --verbose --show-diff-on-failure | ||
rye run -- pre-commit run --all-files --color always --verbose --show-diff-on-failure |