Skip to content

Commit f83eab4

Browse files
committed
enforce ruff
1 parent 7e52559 commit f83eab4

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
name: CI # the name of our workflow is 'CI'
1+
name: CI
22

3-
# run this workflow when we push to the 'main' branch
43
on:
54
push:
65
branches: [main]
6+
pull_request:
7+
branches: [main]
78

8-
# the list of jobs in this workflow
99
jobs:
10-
11-
# define a job
1210
build:
13-
name: Build and Push Container Image # the job's full name
14-
runs-on: ubuntu-latest # the OS that this job runs on
15-
16-
# we need write permissions to publish the package
11+
name: Build and Push Container Image
12+
runs-on: ubuntu-latest
13+
1714
permissions:
1815
packages: write
19-
20-
# the steps that this job consists of
16+
2117
steps:
22-
- name: Checkout # check out our repo
18+
- name: Checkout
2319
uses: actions/checkout@v3
20+
21+
- name: Initialise python
22+
uses: actions/set-up-python@v4
23+
with:
24+
python-version: '3.12'
25+
26+
- name: Install Ruff
27+
run: pip install ruff
28+
29+
- name: Check formatting with Ruff
30+
run: ruff check . --format=github
2431

2532
- name: Log in to the container registry
2633
uses: docker/login-action@v2
@@ -29,17 +36,15 @@ jobs:
2936
username: ${{ github.repository_owner }}
3037
password: ${{ secrets.GITHUB_TOKEN }}
3138

32-
# generate the tags that we'll use to name our image
3339
- name: Get Docker metadata
3440
id: meta
3541
uses: docker/metadata-action@v4
3642
with:
3743
images: ghcr.io/${{ github.repository }}
38-
tags: | # tag with commit hash and with 'latest'
44+
tags: |
3945
type=sha
4046
type=raw,value=latest,enable={{is_default_branch}}
4147
42-
# build and push our image, using output from previous step
4348
- name: Build and push Docker image
4449
uses: docker/build-push-action@v3
4550
with:

0 commit comments

Comments
 (0)