name: CI/CD

on:
  push:
    branches:
      - master
  pull_request: {}
  workflow_dispatch: {}

jobs:

  test:
    name: Test
    strategy:
      matrix:
        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
        os: ['ubuntu-latest', 'macos-latest']
    runs-on: ${{ matrix.os }}

    steps:

      - uses: actions/checkout@v3

      - uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip'
          cache-dependency-path: requirements-test.txt

      - name: Install dependencies
        run: pip install --use-pep517 -r requirements-test.txt .

      - name: Test
        run: pytest

name: CI/CD

on:
  push:
    branches:
      - master
  pull_request: {}
  workflow_dispatch: {}

jobs:

  test:
    name: Test
    strategy:
      matrix:
        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
        os: ['ubuntu-latest', 'macos-latest']
    runs-on: ${{ matrix.os }}

    steps:

      - uses: actions/checkout@v3

      - uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip'
          cache-dependency-path: requirements-test.txt

      - name: Install dependencies
        run: pip install --use-pep517 -r requirements-test.txt .

      - name: Test
        run: pytest

  release:
    name: Release
    strategy:
      matrix:
        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
        os: ['ubuntu-latest', 'macos-latest']
    runs-on: ${{ matrix.os }}

    if: github.ref == 'refs/heads/master'

    needs:
      - test

    steps:

      - uses: actions/checkout@v3

      - uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip'
          cache-dependency-path: requirements-test.txt

      - name: Install dependencies
        run: pip install -r requirements-build.txt

      - name: Build
        run: |
          python setup.py sdist bdist_wheel
          twine check dist/*

Add build step to CI
Add build step to CI
