Skip to content

Commit 323c2ad

Browse files
committed
ci: add PR check workflow
1 parent 6257f16 commit 323c2ad

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/pr.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: yt_clipper
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- test-ci
8+
9+
jobs:
10+
check:
11+
defaults:
12+
run:
13+
shell: bash
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
max-parallel: 4
17+
matrix:
18+
python-version: ['3.12.x']
19+
node-version: ['20.16.x']
20+
poetry-version: ['1.8.3']
21+
os: [macos-13]
22+
include:
23+
- os: macos-13
24+
shortos: macos
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
cache: 'yarn'
34+
architecture: 'x64'
35+
36+
- name: Install poetry
37+
run: pipx install poetry
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
cache: 'poetry'
43+
44+
- name: Install clipper python dependencies
45+
run: |
46+
poetry install --no-interaction --no-root
47+
48+
- name: Lint
49+
run: |
50+
npm run lint:py
51+
52+
- name: Check format
53+
run: |
54+
npm run pretty:py:check
55+
56+
- name: Run clipper tests
57+
run: |
58+
npm run test:py

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"scripts": {
2222
"pretty:ts": "npx prettier \"src/**/*.{ts,js,json}\" --write",
2323
"pretty:py": "poetry run ruff check --select I --fix src/clipper && poetry run ruff format src/clipper",
24+
"pretty:py:check": "poetry run ruff format --check src/clipper",
2425
"test:py": "poetry run pytest src/clipper -s --cov=src/clipper --cov-report=html -m \"not slow\"",
2526
"test:py:slow": "poetry run pytest src/clipper --cov=src/clipper --cov-report=html",
2627
"lint:py": "poetry run ruff check src/clipper",

0 commit comments

Comments
 (0)