Skip to content

Commit 1e6ae04

Browse files
Improve workflows and align project dependencies (#288)
* add tutorial dependencies in pyproject.toml * workflow: implement new workflows for tutorial, tag, and master cleaning
1 parent 1508219 commit 1e6ae04

14 files changed

Lines changed: 377 additions & 102 deletions
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: "./ezyrb"
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 }} # Creates pull request onto pull request or commit branch
29+
branch: actions/black
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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', '3.13']
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install Python dependencies
22+
run: |
23+
python3 -m pip install --upgrade pip
24+
python3 -m pip install .[test]
25+
- name: Test with pytest
26+
run: |
27+
python3 -m pytest
28+
29+
monthly_tag:
30+
runs-on: ubuntu-latest
31+
needs: test
32+
steps:
33+
- uses: actions/checkout@v4
34+
with:
35+
token: ${{ secrets.PAT_EZYRB_PUSH }}
36+
37+
- name: Create and push the tag
38+
run: |
39+
python utils/mathlab_versioning.py set --only-date "post$(date +%y%m)"
40+
VERS=$(python utils/mathlab_versioning.py get)
41+
git config --global user.name 'Monthly Tag bot'
42+
git config --global user.email 'mtbot@noreply.github.com'
43+
git add pyproject.toml
44+
git commit -m "monthly version $VERS"
45+
git tag -a "v$VERS" -m "Monthly version $VERS"
46+
git push origin "v$VERS"

.github/workflows/tester.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: "Testing Pull Request"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "master"
7+
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [windows-latest, macos-latest, ubuntu-latest]
15+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
16+
17+
env:
18+
CFLAGS: "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types"
19+
CXXFLAGS: "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types"
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Install system dependencies (Linux)
30+
if: runner.os == 'Linux'
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y libboost-serialization-dev libprotobuf-dev protobuf-compiler libopenblas-dev liblapack-dev
34+
35+
- name: Set up Java for PyCOMPSs
36+
if: runner.os == 'Linux'
37+
uses: actions/setup-java@v3
38+
with:
39+
distribution: 'temurin'
40+
java-version: '11'
41+
42+
- name: Install Python dependencies
43+
shell: bash
44+
run: |
45+
python3 -m pip install --upgrade pip
46+
python3 -m pip install setuptools wheel
47+
if [ "$RUNNER_OS" == "Linux" ]; then
48+
python3 -m pip install pycompss --no-build-isolation
49+
fi
50+
python3 -m pip install .[test]
51+
52+
- name: Test with pytest
53+
shell: bash
54+
run: |
55+
if [ "$RUNNER_OS" == "Linux" ]; then
56+
python3 -m pytest
57+
else
58+
python3 -m pytest --ignore=tests/test_parallel/
59+
fi
60+
61+
linter: ####################################################################
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Run Black formatter (check mode)
67+
uses: psf/black@stable
68+
with:
69+
src: "./ezyrb"
70+
71+
testdocs: ##################################################################
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Install system dependencies
77+
run: sudo apt-get update && sudo apt-get install -y pandoc
78+
79+
- name: Install Python dependencies
80+
run: python3 -m pip install .[docs]
81+
82+
- name: Build Documentation
83+
run: |
84+
make html
85+
working-directory: docs/
86+
87+
coverage: ##################################################################
88+
runs-on: ubuntu-latest
89+
permissions:
90+
contents: write
91+
pull-requests: write
92+
93+
steps:
94+
- uses: actions/checkout@v4
95+
96+
- name: Install system dependencies (Linux)
97+
run: |
98+
sudo apt-get update
99+
sudo apt-get install -y libboost-serialization-dev libprotobuf-dev protobuf-compiler libopenblas-dev liblapack-dev
100+
101+
- name: Install Python dependencies
102+
run: |
103+
python3 -m pip install --upgrade pip
104+
python3 -m pip install setuptools wheel
105+
python3 -m pip install pycompss --no-build-isolation
106+
python3 -m pip install .[test]
107+
108+
- name: Generate coverage report
109+
run: |
110+
python3 -m pytest --cov-report term --cov-report xml:cobertura.xml --cov=ezyrb
111+
112+
- name: Produce the coverage report
113+
if: github.event.pull_request.head.repo.full_name == github.repository
114+
uses: insightsengineering/coverage-action@v2
115+
with:
116+
path: ./cobertura.xml
117+
threshold: 80.00
118+
fail: true
119+
publish: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
120+
coverage-summary-title: "Code Coverage Summary"

.github/workflows/testing_pr.yml

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

0 commit comments

Comments
 (0)