This repository was archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (74 loc) · 2.2 KB
/
Copy pathworkflow.yml
File metadata and controls
75 lines (74 loc) · 2.2 KB
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
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.8-dev', '3.9', '3.9-dev', '3.10-dev']
os: ['ubuntu-latest', 'macos-latest']
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: true
- name: Python ${{ matrix.python }} on ${{ matrix.os }}
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python }}
- name: Install packages
run: |
python -m pip install --upgrade pip
pip install build
pyproject-build --wheel --outdir dist .
find dist -name "*.whl" | xargs pip3 install
pip install flake8 pytest
- name: Show python version and plugin package
run: |
python --version
pip show sopel_plugins.pingpong
- name: Run tests
run: |
flake8 sopel_pingpong/pingpong --max-line-length 265 --exclude=dist/*,build/*
pytest tests
- name: Run pip freeze
run: |
pip freeze
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Set up Python 3.9
uses: actions/setup-python@v2.2.2
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel
run: >-
python -m
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:
- uses: actions/checkout@v2.3.4
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 }}