Skip to content

Commit 5ad9cee

Browse files
authored
Merge pull request #322 from oskarsh/beta
v4.0
2 parents 51d40b1 + 786a720 commit 5ad9cee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2724
-568
lines changed

.flake8

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
[flake8]
2-
exclude = resources_rc.py,.venv,main_window.py
2+
exclude =
3+
yin_yang/ui/resources_rc.py,
4+
yin_yang/ui/main_window.py,
5+
.venv,
6+
build,
7+
dist
8+
max-line-length = 127
9+
max-complexity = 10
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build and Release Yin-Yang
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: "Build application as Whl"
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.12"]
14+
os: [ubuntu-24.04]
15+
runs-on: ${{matrix.os}}
16+
steps:
17+
# Checkout repo and set up python
18+
- uses: actions/checkout@v4
19+
- name: Install Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{matrix.python-version}}
23+
# Install and configure poetry
24+
- name: Install Poetry
25+
uses: abatilo/actions-poetry@v2
26+
- name: Set up local virtual environment
27+
run: |
28+
poetry config virtualenvs.create true --local
29+
poetry config virtualenvs.in-project true --local
30+
# Load cached venv if it exists
31+
- name: Cache packages
32+
id: cached-poetry-dependencies
33+
uses: actions/cache@v4
34+
with:
35+
# This path is specific to ubuntu
36+
path: ./.venv
37+
key: venv-${{ hashFiles('poetry.lock') }}
38+
# Install dependencies of cache does not exist
39+
- name: Install system dependencies
40+
run: |
41+
sudo apt update
42+
sudo apt install -y qt6-base-dev libsystemd-dev gcc
43+
- name: Install Poetry dependencies
44+
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
45+
run: |
46+
poetry sync --no-interaction
47+
# Compile and build Yin-Yang
48+
- name: Compile ui, translations and resources
49+
run: poetry run ./scripts/build_ui.sh
50+
- name: Build Whl for release
51+
run: poetry build -f wheel -n -o .
52+
# Upload build artifacts for later use
53+
- name: Upload yin_yang whl for flatpak build
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: yin_yang-${{ github.sha }}-py3-none-any.whl
57+
path: '*.whl'
58+
59+
flatpak:
60+
name: "Build flatpak file"
61+
runs-on: ubuntu-24.04
62+
needs: build
63+
container:
64+
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8
65+
options: --privileged
66+
strategy:
67+
matrix:
68+
arch: [x86_64]
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Download build from last step
72+
uses: actions/download-artifact@v4
73+
with:
74+
path: dist/
75+
name: yin_yang-${{ github.sha }}-py3-none-any.whl
76+
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
77+
with:
78+
bundle: yin_yang.flatpak
79+
manifest-path: sh.oskar.yin_yang.json
80+
cache-key: flatpak-builder-${{ github.sha }}
81+
arch: x86_64

.github/workflows/python-app.yml

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

.github/workflows/python-ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
3+
name: Python CI
4+
5+
on:
6+
pull_request:
7+
branches: [master, beta]
8+
9+
jobs:
10+
ci:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.12"]
15+
os: [ubuntu-24.04]
16+
runs-on: ${{matrix.os}}
17+
steps:
18+
# Checkout repo and set up python
19+
- uses: actions/checkout@v4
20+
- name: Install Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{matrix.python-version}}
24+
# Install and configure poetry
25+
- name: Install Poetry
26+
uses: abatilo/actions-poetry@v2
27+
- name: Set up local virtual environment
28+
run: |
29+
poetry config virtualenvs.create true --local
30+
poetry config virtualenvs.in-project true --local
31+
# Load cached venv if it exists
32+
- name: Cache packages
33+
id: cached-poetry-dependencies
34+
uses: actions/cache@v4
35+
with:
36+
# This path is specific to ubuntu
37+
path: ./.venv
38+
key: venv-${{ hashFiles('poetry.lock') }}
39+
# Install dependencies of cache does not exist
40+
- name: Install system dependencies
41+
run: |
42+
sudo apt update
43+
sudo apt install -y qt6-base-dev libsystemd-dev gcc
44+
- name: Install Poetry dependencies
45+
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
46+
run: |
47+
poetry sync --no-interaction
48+
# Build and test Yin-Yang
49+
- name: Compile ui, translations and resources
50+
run: poetry run ./scripts/build_ui.sh
51+
- name: Lint with flake8
52+
run: |
53+
# stop the build if there are Python syntax errors or undefined names
54+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
55+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
56+
poetry run flake8 . --count --statistics
57+
- name: Test with pytest
58+
run: |
59+
poetry run pytest -v

0 commit comments

Comments
 (0)