Skip to content

Run Tests and Publish Desktop App #9

Run Tests and Publish Desktop App

Run Tests and Publish Desktop App #9

Workflow file for this run

name: Run Tests and Publish Desktop App
on:
push:
branches:
- main
tags:
- 'v*' # Trigger only when pushing a version tag (e.g., v1.0.0)
release:
types: [created] # Also trigger if a release is created manually
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Run Tests
run: pytest --cov=solver --cov=parser
build:
needs: test
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install -r requirements.txt pyinstaller
- name: Build Executable
run: |
pyinstaller --onefile --name equation-solver app.py
shell: bash
- name: Rename Executables for OS Compatibility
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
mv dist/equation-solver.exe equation-solver-windows.exe
else
mv dist/equation-solver equation-solver-linux
fi
shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: equation-solver-${{ runner.os }}
path: equation-solver-*
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: List Downloaded Files
run: ls -R dist
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
files:
- dist/equation-solver-windows.exe

Check failure on line 90 in .github/workflows/cross_release.yaml

View workflow run for this annotation

GitHub Actions / Run Tests and Publish Desktop App

Invalid workflow file

The workflow is not valid. .github/workflows/cross_release.yaml (Line: 90, Col: 13): A sequence was not expected
- dist/equation-solver-linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}