This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
87 lines (86 loc) · 2.93 KB
/
workflow.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
name: 'Main CI Build'
on: [push, pull_request_target]
jobs:
test:
name: Test Build (Python ${{ matrix.python }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.8', '3.9', '3.9-dev', '3.10-dev']
os: ['ubuntu-latest', 'macos-latest']
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python ${{ matrix.python }} on ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install packages
run: |
python -m pip install --upgrade pip==21.3.1 wheel
pip install -r dev-requirements.txt
pyproject-build --wheel --outdir dist .
find dist -name "*.whl" | xargs pip3 install
- name: Show python version and show package
run: |
python --version
sopel --version
pip show MirahezeBot-Plugins
- name: Run tests
run: |
flake8 .
pytest --pyargs MirahezeBots.tests
bandit MirahezeBots -r -x MirahezeBots/test
mypy -p MirahezeBots --exclude=build --ignore-missing-imports --disallow-untyped-defs
pip install -r compatibility.txt
pip check
- name: Run pip freeze and pipdeptree
run: |
pip freeze
pipdeptree
- name: Show outdated packages
run: pip list --outdated
deploy:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
run: |
python -m pip install --upgrade pip==21.1.0
pip install -r dev-requirements.txt
- name: Build a binary wheel
run: pyproject-build --wheel --outdir dist .
- name: Publish to PyPi
if: github.event_name == 'push' && github.ref == 'refs/heads/release'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_token }}
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}