build(CICD): split CICD in 2 files for serverlibrary and wallpaper_changer
This commit is contained in:
1 parent
7a5f062ca8
commit
a6063921e5
3 files changed
+155
-132
No files matched your search
@@ -0,0 +1,104 @@
|
||||
name: Wallpaper Changer CI
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Serverlibrary CI
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
test-wallpaper-changer:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out the tested commit
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha }}
|
||||
|
||||
- name: Install serverlibrary and wallpaper_changer
|
||||
working-directory: wallpaper_changer/python
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install ../../serverlibrary
|
||||
python -m pip install --group test .
|
||||
|
||||
- name: Run wallpaper_changer tests
|
||||
working-directory: wallpaper_changer/python
|
||||
run: python tests/run_tests.py all
|
||||
|
||||
lint-wallpaper-changer:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out the tested commit
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha }}
|
||||
|
||||
- name: Install Ruff
|
||||
run: python -m pip install ruff
|
||||
|
||||
- name: Lint wallpaper_changer
|
||||
run: ruff check wallpaper_changer/python
|
||||
|
||||
build:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
needs:
|
||||
- test-wallpaper-changer
|
||||
- lint-wallpaper-changer
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out the tested commit
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha }}
|
||||
|
||||
- name: Install build dependencies
|
||||
working-directory: wallpaper_changer/python
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install ../../serverlibrary
|
||||
python -m pip install --group test .
|
||||
python -m pip install build
|
||||
|
||||
- name: Build executable
|
||||
working-directory: wallpaper_changer/python
|
||||
run: |
|
||||
python -m PyInstaller \
|
||||
--clean \
|
||||
--onefile \
|
||||
--paths src \
|
||||
--name wallpaper_changer \
|
||||
main.py
|
||||
|
||||
- name: Build wheel
|
||||
working-directory: wallpaper_changer/python
|
||||
run: python -m build --wheel
|
||||
|
||||
- name: Verify build outputs
|
||||
working-directory: wallpaper_changer/python
|
||||
run: |
|
||||
ls -lh dist/
|
||||
test -f dist/wallpaper_changer
|
||||
ls dist/*.whl
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: wallpaper-changer-build
|
||||
path: wallpaper_changer/python/dist/
|
||||
if-no-files-found: error
|
||||
Reference in new issue
Block a user