Buses and Equipment lists views #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
upload_artifacts: | |
description: 'Upload build artifacts' | |
required: true | |
default: false | |
type: boolean | |
push: | |
branches: | |
- main | |
- 'release/v**' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' | |
release: | |
types: | |
- published | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
env: | |
DISPLAY: :99 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Xvfb (Linux only) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y xvfb | |
Xvfb -ac $DISPLAY -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
- name: Test with pytest | |
run: | | |
coverage run --branch -m pytest tests | |
coverage xml | |
coverage report | |
- name: SonarCloud Scan (Linux only) | |
if: matrix.os == 'ubuntu-latest' | |
uses: SonarSource/sonarcloud-github-action@v3.1.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Build application with PyInstaller | |
run: pyinstaller -y yagat.spec | |
- name: Upload application Artifact | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.upload_artifacts }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: yagat-${{ matrix.os }} | |
path: dist/yagat* | |
- name: Upload release package | |
if: ${{ github.event_name == 'release' }} | |
uses: softprops/action-gh-release@v2.0.9 | |
with: | |
files: yagat_*_*.zip |