Skip to content

Commit

Permalink
ci: smoke test for pikaraoke
Browse files Browse the repository at this point in the history
  • Loading branch information
mariugul committed Sep 3, 2024
1 parent b7cd79c commit bbae69c
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- master

env:
PYTHON_VERSION: '3.9'

jobs:
code-quality:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,3 +54,81 @@ jobs:
steps:
- name: Run commitlint
uses: opensource-nepal/commitlint@v1

smoketest:
runs-on: ${{ matrix.os }}
name: Smoke Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Cache Poetry Install
id: cache-poetry
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
.venv
${{ runner.os == 'windows-latest' && 'C:\\opt\\poetry' || (runner.os == 'macos-latest' && '$HOME/.poetry') || '/opt/poetry' }}
key: ${{ matrix.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/pyproject.toml')
}}

- name: Install Poetry on macOS
if: steps.cache-poetry.outputs.cache-hit != 'true' && runner.os == 'macOS'
run: |
export POETRY_HOME=$HOME/.poetry
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.8.2
$POETRY_HOME/bin/poetry --version
shell: bash

- name: Install Poetry on Linux/macOS
if: steps.cache-poetry.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: |
if [ $RUNNER_OS = 'macOS' ]; then
export POETRY_HOME=$HOME/.poetry
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.8.2
$POETRY_HOME/bin/poetry --version
else
export POETRY_HOME=/opt/poetry
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.8.2
$POETRY_HOME/bin/poetry --version
fi
- name: Install Poetry on Windows
if: steps.cache-poetry.outputs.cache-hit != 'true' && runner.os == 'Windows'
shell: pwsh
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Add Poetry to PATH
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
if [ $RUNNER_OS = 'Linux' ]; then
echo "/opt/poetry/bin" >> $GITHUB_PATH
elif [ $RUNNER_OS = 'macOS' ]; then
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
fi
- name: Add Poetry to PATH
if: runner.os == 'Windows'
run: |
echo "C:\\opt\\poetry\\Scripts" >> $GITHUB_PATH
echo "$env:USERPROFILE\\.poetry\\bin" >> $env:GITHUB_PATH
- name: Install Package
run: poetry install --no-interaction --no-ansi

- name: Verify Install
run: poetry run pikaraoke --help

0 comments on commit bbae69c

Please sign in to comment.