Skip to content

Commit 0486dbb

Browse files
authored
Merge actions in one orkflow and make set right triggers (#8)
* merge actions in one orkflow and make set right triggers * omit run-name
1 parent 147a9da commit 0486dbb

4 files changed

Lines changed: 103 additions & 108 deletions

File tree

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: dac actions
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
12+
check-style:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout πŸ”–
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 1
19+
- name: Setup python 🐍
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.11'
23+
- name: Setup cache πŸ’Ύ
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.cache/pre-commit
27+
key: pre-commit
28+
- name: Prepare pre-commit πŸ™†β€β™‚οΈπŸ‘—
29+
run: |
30+
python -m venv venv || . venv/bin/activate
31+
pip install -U pip wheel setuptools pre-commit
32+
pre-commit install
33+
- name: Run pre-commit πŸ‘—πŸš€
34+
run: |
35+
pre-commit run
36+
37+
test:
38+
runs-on: "${{ matrix.os }}"
39+
strategy:
40+
matrix:
41+
os: ["ubuntu-latest"]
42+
version: ["3.9", "3.10", "3.11"]
43+
steps:
44+
- name: Checkout πŸ”–
45+
uses: actions/checkout@v3
46+
with:
47+
fetch-depth: 1
48+
- name: Setup python 🐍
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: "${{ matrix.version }}"
52+
- name: Prepare tests πŸ™†β€β™‚οΈπŸ”¬
53+
run: |
54+
python -m venv venv || . venv/bin/activate
55+
pip install -U pip wheel setuptools
56+
pip install -r requirements-test.txt
57+
- name: Run tests πŸ”¬πŸš€
58+
run: |
59+
pytest test --run-slow
60+
61+
docs:
62+
needs: [test, check-style]
63+
if: ${{ github.ref == 'refs/heads/main' }}
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout πŸ”–
67+
uses: actions/checkout@v3
68+
- name: Setup python 🐍
69+
uses: actions/setup-python@v4
70+
with:
71+
python-version: "3.11"
72+
- name: Build and push docs πŸ“”πŸš€
73+
run: |
74+
pip install -r requirements-docs.txt
75+
mkdocs gh-deploy --force
76+
77+
pypi-release:
78+
needs: [test, check-style]
79+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Checkout πŸ”–
83+
if: ${{ github.event_name == 'release' }}
84+
uses: actions/checkout@v3
85+
with:
86+
fetch-depth: 1
87+
- name: Setup python 🐍
88+
uses: actions/setup-python@v4
89+
with:
90+
python-version: "3.11"
91+
- name: Prepare release πŸ™†β€β™‚οΈπŸ“¦test
92+
run: |
93+
python -m venv venv || . venv/bin/activate
94+
pip install -U pip wheel setuptools build twine
95+
- name: Build πŸ› οΈπŸ“¦
96+
run: |
97+
python -m build
98+
- name: Release πŸ“¦πŸš€
99+
env:
100+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
101+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
102+
run: |
103+
python -m twine upload dist/*

β€Ž.github/workflows/docs.ymlβ€Ž

Lines changed: 0 additions & 22 deletions
This file was deleted.

β€Ž.github/workflows/pypi-release.ymlβ€Ž

Lines changed: 0 additions & 34 deletions
This file was deleted.

β€Ž.github/workflows/test.ymlβ€Ž

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
Β (0)