-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (92 loc) · 2.72 KB
/
Copy pathbuild.yaml
File metadata and controls
105 lines (92 loc) · 2.72 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# SPDX-License-Identifier: MIT
name: Build
on:
push:
branches:
- main
paths:
- '**/*.py'
- 'pyproject.toml'
- '.github/workflows/build.yaml' # This workflow
- '.github/actions/python_setup/actions.yaml'
pull_request:
branches:
- main
paths:
- '**/*.py'
- 'pyproject.toml'
- '.github/workflows/build.yaml' # This workflow
- '.github/actions/python_setup/actions.yaml'
env:
LC_ALL: en_US.UTF-8
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
unit-test:
runs-on: "${{ matrix.platform }}"
strategy:
matrix:
python:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
platform:
- 'ubuntu-latest'
steps:
- name: "Harden Runner"
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: 'Setup Python ${{ matrix.python }}'
uses: ./.github/actions/python_setup
with:
python-version: ${{ matrix.python }}
- name: Unit tests
run: |
uvx --with tox-uv --with tox-gh -- tox
env:
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }}
lint:
name: "${{ matrix.lint.name }}"
runs-on: "${{ matrix.platform }}"
strategy:
fail-fast: false
matrix:
python:
- '3.13'
platform:
- 'ubuntu-latest'
lint:
- name: 'ruff'
commands: |
uvx --with tox-uv -- tox -e ruffcheck
- name: 'pylint'
commands: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
uvx --with tox-uv -- tox -e pylint
- name: 'mypy'
commands: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
uvx --with tox-uv -- tox -e mypy
steps:
- name: "Harden Runner"
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: 'Setup Python ${{ matrix.python }}'
uses: ./.github/actions/python_setup
with:
python-version: ${{ matrix.python }}
- name: "${{ matrix.lint.name }}"
run: |
${{ matrix.lint.commands }}
env:
RUFF_OUTPUT_FORMAT: github