diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 91bc43a..efd5641 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,12 +1,13 @@ -name: "Specklepy test and build" +name: "Specklepy test" on: + workflow_call: pull_request: branches: - - "v3-dev" + - "main" jobs: - build-and-test: - name: build-and-test + test: + name: test runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea53137..c665687 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,63 +2,18 @@ name: "Publish Python Package" on: push: branches: - - "v3-dev" + - "main" tags: - "3.*.*" jobs: - build-and-test: - name: continuous-integration - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - steps: - - uses: actions/checkout@v4 - - - name: Install uv and set the python version - uses: astral-sh/setup-uv@v5 - with: - python-version: ${{ matrix.python-version }} - enable-cache: true - cache-dependency-glob: "uv.lock" - - - name: Install the project - run: uv sync --all-extras --dev - - - uses: actions/cache@v3 - with: - path: ~/.cache/pre-commit/ - key: ${{ hashFiles('.pre-commit-config.yaml') }} - - - name: Run pre-commit - run: uv run pre-commit run --all-files - - - name: Run Speckle Server - run: docker compose up -d - - # - name: Run tests - # run: uv run pytest --cov --cov-report xml:reports/coverage.xml --junitxml=reports/test-results.xml - - # - uses: codecov/codecov-action@v5 - # if: matrix.python-version == 3.13 - # with: - # fail_ci_if_error: true # optional (default = false) - # files: ./reports/test-results.xml # optional - # token: ${{ secrets.CODECOV_TOKEN }} - - - name: Minimize uv cache - run: uv cache prune --ci + test: + uses: "./.github/workflows/pr.yml" publish-package: name: "Build and Publish Python Package" runs-on: ubuntu-latest - needs: build-and-test + needs: test # set the environment based on what triggered the workflow environment: @@ -79,7 +34,7 @@ jobs: - name: "Build package artifacts" run: uv build - # Logic for TestPyPI (on v3-dev branch push) + # Logic for TestPyPI (on main branch push) - name: "Publish to TestPyPI" if: ${{ github.ref_type == 'branch' }} run: uv publish --index test