-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (59 loc) · 1.9 KB
/
style.yml
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
# This workflow runs automatic code style checks.
# We need a workflow name to be able to schedule it from Github UI
name: style
on:
# Triggers the workflow on push to main
push:
branches:
- main
# Triggers the workflow on any PR
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# The job ID has to match repo settings for PR required checks
style:
runs-on: ubuntu-latest
# Run jobs for a couple of Python versions.
strategy:
matrix:
# Choice of Python versions to run against:
# * 3.9: the oldest supported version
# * 3.11: the latest officially supported version. Used in CE images.
python: ["3.9", "3.11"]
name: Style - Python ${{ matrix.python }}
timeout-minutes: 25
steps:
- uses: actions/checkout@v3
# Load a specific version of Python
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: x64
cache: 'pip'
# Installation method (venv/system/etc) affects Ray behavior. We're
# installing deps to a venv to align with the most common use case.
# Hence, we'll need to ensure the venv is always activated. More info:
# https://stackoverflow.com/questions/74668349/how-to-activate-a-virtualenv-in-a-github-action
- name: Install deps
shell: bash
run: |
python3 -m venv ./venv
source ./venv/bin/activate
make github_actions
- name: Check style
shell: bash
run: |
source ./venv/bin/activate
make style
ruff:
runs-on: ubuntu-latest
name: Style - Ruff
timeout-minutes: 25
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1