Skip to content

Commit

Permalink
ci: expand smoke test to all OS
Browse files Browse the repository at this point in the history
Adds windows and macOS to smoke tests.
  • Loading branch information
mariugul committed Sep 3, 2024
1 parent f01e6c9 commit cc0d46a
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ jobs:
uses: opensource-nepal/commitlint@v1

smoketest:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
name: Smoke Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -72,22 +75,34 @@ jobs:
uses: actions/cache@v4
with:
path: |
/opt/poetry
~/.cache/pypoetry
.venv
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/pyproject.toml')
${{ runner.os == 'windows-latest' && 'C:\\opt\\poetry' || '/opt/poetry' }}
key: ${{ matrix.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/pyproject.toml')
}}

- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
export POETRY_HOME=/opt/poetry
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.8.2
$POETRY_HOME/bin/poetry --version
if [ $RUNNER_OS = 'Windows' ]; then
set POETRY_HOME=C:\opt\poetry
python -m venv %POETRY_HOME%
%POETRY_HOME%\Scripts\pip install poetry==1.8.2
%POETRY_HOME%\Scripts\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: Add Poetry to PATH
run: echo "/opt/poetry/bin" >> $GITHUB_PATH
run: |
if [ $RUNNER_OS = 'Windows' ]; then
echo "C:\\opt\\poetry\\Scripts" >> $GITHUB_PATH
else
echo "/opt/poetry/bin" >> $GITHUB_PATH
fi
- name: Install Package
run: poetry install --no-interaction --no-ansi
Expand Down

0 comments on commit cc0d46a

Please sign in to comment.