Skip to content

Commit d9c4dd2

Browse files
committed
actions
1 parent d73dbae commit d9c4dd2

File tree

4 files changed

+94
-8
lines changed

4 files changed

+94
-8
lines changed

.github/workflows/Test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: 'Tests'
2+
3+
on: [push]
4+
5+
jobs:
6+
call_workflow:
7+
uses: ./.github/workflows/Testbase.yml
8+
with:
9+
python: '3.11'
10+
qt5: 'pyqt5'

.github/workflows/Testbase.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Base
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python:
7+
required: true
8+
type: string
9+
qt5:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
env:
17+
DISPLAY: ':99.0'
18+
QT_DEBUG_PLUGINS: 1
19+
steps:
20+
- name: Set up Python ${{ inputs.python }}
21+
uses: actions/checkout@v4
22+
- name: Install dependencies
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ inputs.python }}
26+
- name: Install package
27+
run: |
28+
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
29+
python -m pip install --upgrade pip
30+
export QT_DEBUG_PLUGINS=1
31+
pip install flake8 pytest pytest-cov pytest-qt pytest-xdist pytest-xvfb setuptools wheel numpy h5py ${{ inputs.qt5 }} toml
32+
pip install pymodaq pyqt5
33+
pip install -e .
34+
- name: create local pymodaq folder and setting permissions
35+
run: |
36+
sudo mkdir /etc/.pymodaq
37+
sudo chmod uo+rw /etc/.pymodaq
38+
- name: Linting with flake8
39+
run: |
40+
# stop the build if there are Python syntax errors or undefined names
41+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=src/pymodaq/resources/QtDesigner_Ressources,docs
42+
- name: Test with pytest
43+
run: |
44+
pytest -n auto

.github/workflows/python-publish.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,28 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: '3.x'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine toml
25-
- name: Build and publish
24+
pip install hatch hatchling toml twine
25+
- name: Get history and tags for SCM versioning to work
26+
run: |
27+
git branch
28+
git fetch --prune --unshallow
29+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
30+
hatch version
31+
- name: Build
32+
run: hatch build
33+
- name: Check the build
34+
run: twine check dist/*
35+
- name: publish
2636
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
37+
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
38+
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
2939
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
40+
hatch publish

.github/workflows/updater.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: GitHub Actions Version Updater
2+
3+
# Controls when the action will run.
4+
on:
5+
schedule:
6+
# Automatically run at 00:00 on day-of-month 5.
7+
- cron: '0 0 5 * *'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
# [Required] Access token with `workflow` scope.
17+
token: ${{ secrets.WORKFLOW_SECRET }}
18+
19+
- name: Run GitHub Actions Version Updater
20+
uses: saadmk11/[email protected]
21+
with:
22+
# [Required] Access token with `workflow` scope.
23+
token: ${{ secrets.WORKFLOW_SECRET }}

0 commit comments

Comments
 (0)