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
76 lines (75 loc) · 2.22 KB
/
workflow.yml
File metadata and controls
76 lines (75 loc) · 2.22 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
76
on:
push:
pull_request_target:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.10-dev', '3.11-dev']
os: ['ubuntu-latest', 'macos-latest']
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Python ${{ matrix.python }} on ${{ matrix.os }}
uses: actions/setup-python@v3
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 MirahezeBots_jsonparser
- name: Run tests
run: |
flake8 MirahezeBots_jsonparser --max-line-length 265 --exclude=__init__.py,dist/*,build/*
pytest tests
pytest jsontests/test_json.py
- name: Run pip freeze
run: |
pip freeze
deploy:
runs-on: ubuntu-latest
steps:
- 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
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@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 }}