-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (79 loc) · 2.58 KB
/
check and publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: check and publish
on: push
permissions:
contents: "write"
packages: "write"
pull-requests: "read"
jobs:
test:
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.13"]
# pinning macos version because apparently newer versions of macos don't work with lxml
# https://stackoverflow.com/a/76776773
os: ["ubuntu-latest", "macos-12", "windows-latest"]
robot_version: ["6.1.1", "from lockfile"]
pytest_version: ["8.0", "from lockfile"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- run: ./pw uv sync
- run: ./pw uv add robotframework==${{ matrix.robot_version }}
if: ${{ matrix.robot_version != 'from lockfile' }}
- run: ./pw uv add pytest==${{ matrix.pytest_version }}
if: ${{ matrix.pytest_version != 'from lockfile' }}
- run: ./pw test
static_checks:
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.13"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- run: ./pw uv sync --locked
- run: ./pw typecheck
- name: ruff check
if: always()
run: ./pw uv run ruff check --output-format github
- name: ruff format
if: always()
run: ./pw uv run ruff format --check --diff
- run: ./pw pylint --output-format=github
if: always()
- run: ./pw robocop
if: always()
- run: ./pw robotidy
publish:
runs-on: "ubuntu-latest"
if: github.ref == 'refs/heads/master'
needs:
- static_checks
- test
permissions:
id-token: write
contents: write
packages: write
pull-requests: read
steps:
- uses: actions/checkout@v4
- run: ./pw uv build
- run: ./pw uv publish
- name: get version number
id: current-version
# https://github.com/astral-sh/uv/issues/6298
run: echo ::set-output name=CURRENT_VERSION::$(./pw uv run python -c "from pytest_robotframework._internal import __version__;print(__version__)")
- uses: marvinpinto/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: dist/*
automatic_release_tag: ${{ steps.current-version.outputs.CURRENT_VERSION }}