From a827f4dbc3cf83d5958eea452b7d1deba5d4030c Mon Sep 17 00:00:00 2001 From: Mystic <215104920@qq.com> Date: Sun, 25 Aug 2024 20:18:49 +0800 Subject: [PATCH] ci(python): support make build for macOS, Ubuntu, Win --- .../.github/workflows/ci.yml | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 8abc193..2b131b1 100644 --- a/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -8,7 +8,34 @@ on: workflow_dispatch: jobs: - build: - runs-on: ubuntu-latest + build-and-test: + name: python-${{ matrix.os }} + + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + - macos-latest + + fail-fast: false + + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v4 + + - name: Set up uv + if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} + run: curl -LsSf https://astral.sh/uv/install.sh | sh + + - name: Set up uv + if: ${{ matrix.os == 'windows-latest' }} + run: irm https://astral.sh/uv/install.ps1 | iex + shell: powershell + + - name: Build & Test + run: | + make init + make build + make test