diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a98ee10..5db1ec0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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