name: Continuous integration on: push: # run when commits are added to master or develop branches: - master - develop pull_request: # run on pr's against master or develop branches: - master - develop env: default-python: "3.10" jobs: check-code-formatting: name: Check code formatting runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Check code formatting uses: psf/black@stable check-coding-style: name: Check coding style runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Python ${{ env.default-python }} uses: actions/setup-python@v2 with: python-version: ${{ env.default-python }} - name: Upgrade pip, Install nox run: | python -m pip install --upgrade pip python -m pip install nox - name: Check coding style run: | nox --error-on-missing-interpreters --non-interactive --session lint check-static-types: name: Check static types runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Python ${{ env.default-python }} uses: actions/setup-python@v2 with: python-version: ${{ env.default-python }} - name: Upgrade pip, Install nox run: | python -m pip install --upgrade pip python -m pip install nox - name: Check static types run: | nox --error-on-missing-interpreters --non-interactive --session types tests: name: Run tests runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest ] python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Determine pip cache directory id: pip-cache run: | echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip cache uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip${{ matrix.python-version }} - name: Upgrade pip and install nox run: | python -m pip install --upgrade pip python -m pip install nox - name: Run tests run: | nox --non-interactive --session tests-${{ matrix.python-version }} build-docs: name: Test building docs runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Python ${{ env.default-python }} uses: actions/setup-python@v2 with: python-version: ${{ env.default-python }} - name: Upgrade pip and install nox run: | python -m pip install --upgrade pip python -m pip install nox - name: Build docs run: | nox --error-on-missing-interpreters --non-interactive --session docs