-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·118 lines (113 loc) · 3.8 KB
/
python-ci.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
name: CI
on:
push:
branches: [develop]
paths:
- "src/**"
- "tests/**"
- setup.cfg
- setup.py
- tox.ini
- "requirements/**"
- "docs/**"
workflow_run:
workflows: ["Update Requirements"]
types: [completed]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
concurrency: ci
strategy:
fail-fast: false
matrix:
include:
- {
name: Linux,
python: "3.10",
os: ubuntu-latest,
tox: py310,
}
# - { name: Windows, python: "3.10", os: windows-latest, tox: py310 }
# - { name: Mac, python: "3.10", os: macos-latest, tox: py310 }
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: update-pip
run: |
pip install -U wheel setuptools
python -m pip install -U pip
- name: get-pip-cache-dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: cache-pip
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}
- name: install-utils
run: pip install tox
- name: tests
run: |
tox -e ${{ matrix.tox }}
docs:
needs: [tests]
runs-on: ubuntu-latest
concurrency: docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: install-deps
run: pip install -r requirements/docs.txt
- name: make-docs
run: cd docs && make html
- name: publish-docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
publish:
needs: [tests]
runs-on: ubuntu-latest
concurrency: publish
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: publish
uses: relekang/[email protected]
with:
additional_options: "--patch"
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_TOKEN }}
notify:
needs: [publish]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repo: library-api
- repo: web-core
- repo: client
- repo: library-web
- repo: main-web
- repo: shared-web
steps:
- uses: juztcode/repo-ditpatch-action@v1
with:
event-type: library-objects-published
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: sweetrpg/${{ matrix.repo }}
# - name: dispatch-event
# uses: ph-fritsche/action-dispatch@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# type: repository
# ident: published
# payload: '{"foo":"bar"}' # json