diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30bc0dbe..53a2efde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,47 +1,50 @@ -name: Test +name: CI on: push: - branches: [main] + branches: + - main + tags: + - "v*" pull_request: + workflow_dispatch: + +concurrency: + group: test-${{ github.head_ref }} + cancel-in-progress: true + +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" jobs: Test: - runs-on: ubuntu-latest - + name: Python ${{ matrix.python-version }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - python: ["3.8", "3.9", "3.10"] - - name: Python ${{ matrix.python }} - + os: [ubuntu-latest] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v4 + - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python }} - - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install .[dev,all] - - - name: Run pytest - run: pytest --ignore gosling/examples --ignore tools/altair --doctest-modules gosling + python-version: ${{ matrix.python-version }} + - run: | + pip install --upgrade hatch + hatch run test Deploy: runs-on: ubuntu-latest - - if: contains(github.ref, 'tags') + if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.x" - name: Install dependencies run: | python -m pip install --upgrade pip