-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (66 loc) · 1.72 KB
/
ci.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
# Copyright (c) 2024-present, FriendliAI Inc. All rights reserved.
name: FMO CI
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
paths:
- "**.py"
- "pyproject.toml"
- "tox.ini"
pull_request:
paths:
- "**.py"
- "poetry.lock"
- "pyproject.toml"
- "tox.ini"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Delete unnecessary directories to secure disk capacity.
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf /opt/hostedtoolcache
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set virtual env
run: |
python -m venv env
- name: Load cached venv
uses: actions/cache@v3
id: cache-venv
with:
path: env
key: |
pf-${{ steps.setup-python.outputs.python-version }}-venv-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
source env/bin/activate
pip install --upgrade pip
python -m pip install -e ".[dev]"
if: steps.cached-venv-dependencies.outputs.cache-hit != 'true'
- name: Install tox
run: |
source env/bin/activate
pip install tox
- name: Run lint
run: |
source env/bin/activate
tox run -e lint
# - name: Run tests
# run: |
# source env/bin/activate
# tox run