-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (103 loc) · 3.17 KB
/
pythonapp.yml
File metadata and controls
111 lines (103 loc) · 3.17 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Python application
on: [push, pull_request]
jobs:
lint_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Set up Python 3.x
uses: actions/setup-python@v5.5.0
with:
python-version: 3.x
- name: Lint with pycodestyle
run: |
python3 -m pip install flake8
python3 -m flake8 . --count --ignore=E125,E126,E127,E128,E402,E741,E731,W503,F401,W504,F841 --show-source --statistics --max-line-length=80 --exclude=__pycache__,.tox,.git/,doc/
linux_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Set up Python 3.x
uses: actions/setup-python@v5.5.0
with:
python-version: 3.x
- name: Make sdist
run: |
python3 -m pip install build
python3 -m build --sdist .
- name: Install project
run: python3 -m pip install -e .[dev,network]
- name: Make wheel
run: python3 -m build --wheel .
- name: Upload wheels as artifact
uses: actions/upload-artifact@v4.6.2
with:
name: wheels
path: dist
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2.2.1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: dist/*
draft: true
- name: Test with pytest
run: |
python3 -m pytest --cov=pymoa --cov-report term --cov-branch pymoa/tests
- name: Coveralls upload
run: python3 -m coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
windows_test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Set up Python 3.x
uses: actions/setup-python@v5.5.0
with:
python-version: 3.x
- name: Install dependencies
run: python -m pip install -e .[dev,network]
- name: Test with pytest
run: |
python -m pytest --cov=pymoa --cov-report term --cov-branch pymoa/tests
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Set up Python 3.x
uses: actions/setup-python@v5.5.0
with:
python-version: 3.x
- name: Install dependencies
env:
KIVY_DOC_INCLUDE: 1
KIVY_DOC: 1
run: python3 -m pip install -e .[dev,network]
- name: Generate docs
run: |
cd doc
make html
- name: gh-pages upload
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp -r doc/build/html ~/docs_temp
git config --global user.email "moiein2000@gmail.com"
git config --global user.name "Matthew Einhorn"
git remote rm origin || true
git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/matham/pymoa.git"
git checkout --orphan gh-pages
cp -r .git ~/docs_git
cd ..
rm -rf pymoa
mkdir pymoa
cd pymoa
cp -r ~/docs_git .git
cp -r ~/docs_temp/* .
touch .nojekyll
git add .
git commit -a -m "Docs for git-$GITHUB_SHA"
git push origin gh-pages -f