Skip to content

Commit f720f6a

Browse files
kshitij-mathsndem0
authored andcommitted
workflow: add pina workflows
1 parent fe729f9 commit f720f6a

7 files changed

Lines changed: 360 additions & 96 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Continuous Deployment"
1+
name: "Deployer"
22

33
on:
44
push:
@@ -7,8 +7,6 @@ on:
77

88
jobs:
99

10-
#############################################################################
11-
# Create and online deployment of the documentation #########################
1210
docs: #######################################################################
1311
runs-on: ubuntu-latest
1412
steps:
@@ -21,13 +19,14 @@ jobs:
2119
python-version: "3.10"
2220

2321
- name: Install Dependencies (conda and pip)
24-
shell: bash
22+
shell: bash -el {0}
2523
run: |
26-
conda install --yes -c conda-forge pythonocc-core
24+
conda install --yes -c conda-forge pythonocc-core pip
2725
python -m pip install --upgrade pip
2826
python -m pip install .[docs]
2927
3028
- name: Build Documentation
29+
shell: bash -el {0}
3130
run: |
3231
make html
3332
working-directory: docs/
@@ -38,9 +37,7 @@ jobs:
3837
github_token: ${{ secrets.GITHUB_TOKEN }}
3938
publish_dir: ./docs/build/html
4039
allow_empty_commit: true
41-
42-
#############################################################################
43-
## Create a public "Release" on the Github page #############################
40+
4441
release_github: #############################################################
4542
runs-on: ubuntu-latest
4643
permissions:
@@ -50,3 +47,27 @@ jobs:
5047
- uses: ncipollo/release-action@v1
5148
with:
5249
token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
pypi: #######################################################################
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Setup Python
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: "3.10"
60+
61+
- name: Install build
62+
run: >-
63+
python -m pip install build
64+
65+
- name: Build a binary wheel and a source tarball
66+
run: >-
67+
python -m build --sdist --wheel --outdir dist/ .
68+
69+
- name: Publish distribution to PyPI
70+
if: startsWith(github.ref, 'refs/tags')
71+
uses: pypa/gh-action-pypi-publish@release/v1
72+
with:
73+
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Master Cleaner
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
formatter:
10+
name: runner / black
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: psf/black@stable
16+
with:
17+
src: "./pygem"
18+
19+
- name: Create Pull Request
20+
uses: peter-evans/create-pull-request@v3
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
title: "Format Python code with psf/black push"
24+
commit-message: ":art: Format Python code with psf/black"
25+
body: |
26+
There appear to be some python formatting errors in ${{ github.sha }}. This pull request
27+
uses the [psf/black](https://github.com/psf/black) formatter to fix these issues.
28+
base: ${{ github.head_ref }}
29+
branch: actions/black
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Monthly Tagger"
2+
3+
on:
4+
schedule:
5+
- cron: '20 2 1 * *'
6+
7+
jobs:
8+
9+
test:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [windows-latest, macos-latest, ubuntu-latest]
14+
python-version: ["3.9", "3.10", "3.11", "3.12"]
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Installing conda
18+
uses: conda-incubator/setup-miniconda@v3
19+
with:
20+
auto-update-conda: true
21+
python-version: ${{ matrix.python-version }}
22+
channels: conda-forge
23+
- name: Install Python dependencies
24+
shell: bash -el {0}
25+
run: |
26+
conda install --yes -c conda-forge pythonocc-core
27+
python -m pip install --upgrade pip
28+
python -m pip install .[test]
29+
- name: Test with pytest
30+
shell: bash -el {0}
31+
run: |
32+
python -m pytest
33+
34+
monthly_tag:
35+
runs-on: ubuntu-latest
36+
needs: test
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
token: ${{ secrets.PAT_PYGEM_PUSH }}
41+
42+
- name: Create and push the tag
43+
run: |
44+
VERS="post$(date +%y%m)"
45+
git config --global user.name 'Monthly Tag bot'
46+
git config --global user.email 'mtbot@noreply.github.com'
47+
git commit --allow-empty -m "monthly version $VERS"
48+
git tag -a "v$VERS" -m "Monthly version $VERS"
49+
git push origin "v$VERS"

.github/workflows/tester.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: "Testing Pull Request"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "master"
7+
- "dev"
8+
9+
jobs:
10+
unittests: #################################################################
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [windows-latest, macos-latest, ubuntu-latest]
16+
python-version: ["3.9", "3.10", "3.11", "3.12"]
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Installing conda
21+
uses: conda-incubator/setup-miniconda@v3
22+
with:
23+
auto-update-conda: true
24+
python-version: ${{ matrix.python-version }}
25+
channels: conda-forge
26+
27+
- name: Installing packages
28+
shell: bash -el {0}
29+
run: |
30+
conda install --yes -c conda-forge pythonocc-core pip
31+
python -m pip install --upgrade pip
32+
python -m pip install .[test]
33+
34+
- name: Test with pytest
35+
shell: bash -el {0}
36+
run: |
37+
python -m pytest
38+
39+
linter: ####################################################################
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Run Black formatter (check mode)
45+
uses: psf/black@stable
46+
with:
47+
src: "./pygem"
48+
49+
testdocs: ##################################################################
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Installing conda
55+
uses: conda-incubator/setup-miniconda@v3
56+
with:
57+
auto-update-conda: true
58+
python-version: "3.10"
59+
channels: conda-forge
60+
61+
- name: Install Python dependencies
62+
shell: bash -el {0}
63+
run: |
64+
conda install --yes -c conda-forge pythonocc-core
65+
python -m pip install --upgrade pip
66+
python -m pip install .[docs]
67+
68+
- name: Build Documentation
69+
shell: bash -el {0}
70+
run: |
71+
make html SPHINXOPTS+='-W'
72+
working-directory: docs/
73+
74+
coverage: ##################################################################
75+
runs-on: ubuntu-latest
76+
permissions:
77+
contents: write
78+
pull-requests: write
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Installing conda
84+
uses: conda-incubator/setup-miniconda@v3
85+
with:
86+
auto-update-conda: true
87+
python-version: "3.10"
88+
channels: conda-forge
89+
90+
- name: Install Python dependencies
91+
shell: bash -el {0}
92+
run: |
93+
conda install --yes -c conda-forge pythonocc-core
94+
python -m pip install --upgrade pip
95+
python -m pip install pytest pytest-cov
96+
python -m pip install .[test]
97+
98+
- name: Generate coverage report
99+
shell: bash -el {0}
100+
run: |
101+
python -m pytest --cov-report term --cov-report xml:cobertura.xml --cov=pygem
102+
103+
- name: Produce the coverage report
104+
uses: insightsengineering/coverage-action@v2
105+
with:
106+
path: ./cobertura.xml
107+
threshold: 80.0
108+
fail: true
109+
publish: true
110+
coverage-summary-title: "Code Coverage Summary"

.github/workflows/testing_pr.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)