diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ce8761c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,118 @@ +name: Test + +on: + - push + - pull_request + +jobs: + + # Test different python versions with bash on Ubuntu. + ubuntu: + name: Test Ubuntu + runs-on: ubuntu-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + matrix: + python-version: + - 3.8 + - 3.9 + - "3.10" + - "3.11" + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: python -m pip install tox + + - name: Run tests + run: tox -e py + + # Test the latest python version with zsh on macOS + zsh: + name: Test Zsh + runs-on: macos-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + + - name: Install dependencies + run: python -m pip install tox + + - name: Run tests + run: tox -e zsh + + # Test different python versions with bash on macOS + macos: + name: Test macOS + runs-on: macos-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + matrix: + python-version: + - 3.8 + - 3.9 + - "3.10" + - "3.11" + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: python -m pip install tox + + - name: Run tests + run: tox -e py + + # Run various style checkers + style: + runs-on: ubuntu-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + tox-environment: + - docs + - style + - pkglint + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install dependencies + run: python -m pip install tox + + - name: Run + run: tox -e ${{ matrix.tox-environment }}