Skip to content

Commit 471073e

Browse files
committed
ci: add GitHub Actions (ruff, black, pytest, docker build)
1 parent 99709a0 commit 471073e

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -e ".[dev]"
25+
# tools (explicit, in case dev extras change)
26+
pip install ruff black pytest
27+
28+
- name: Ruff (lint)
29+
run: ruff check .
30+
31+
- name: Black (format check)
32+
run: black --check .
33+
34+
- name: Pytest
35+
run: pytest -q
36+
37+
docker-build:
38+
runs-on: ubuntu-latest
39+
needs: test
40+
if: github.event_name == 'push' # build only on push, not PR
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Build image (no push)
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: .
52+
file: ./Dockerfile
53+
tags: mvtk/sysinfo-cli:ci
54+
load: true
55+

0 commit comments

Comments
 (0)