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 3
91 lines (90 loc) · 2.89 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
88
89
90
91
on:
push:
branches:
- dev
- release
pull_request_target:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.9-dev', '3.10-dev', '3.10']
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: Python ${{ matrix.python }} on ${{ matrix.os }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install packages
run: |
python -m pip install --upgrade pip
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 sopel_plugins.channelmgnt
- name: Run tests
run: |
flake8 .
pytest .
bandit sopel_channelmgnt -r
pip-missing-reqs --ignore-file=setup.py --ignore-module=pytest --ignore-module=MirahezeBots.* . --ignore-file=tests/*
pip-extra-reqs . --ignore-requirement=wheel
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@v3
with:
python-version: 3.9
- name: Install pypa/build
run: |
python -m pip install --upgrade pip
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 }}