diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 7cc5857e..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Upload to PyPI - -on: - # release: - # types: [created] - push: - tags: - - 'v*.*.*' - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - name: Install dependencies - run: | - pip install --upgrade pip - pip install --upgrade build twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python -m build - twine upload dist/* diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 00000000..186c29bf --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,34 @@ +name: Upload to PyPI + +on: + # release: + # types: [created] + push: + tags: + - "v*.*.*" +jobs: + deploy: + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install packages + run: | + pip install --upgrade pip + pip install --upgrade hatch + + - name: Build + run: hatch build + + - name: pypi-publish + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml index 2d8ecd58..690dde43 100644 --- a/.github/workflows/type-check.yml +++ b/.github/workflows/type-check.yml @@ -18,28 +18,21 @@ env: jobs: run: - name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python-version: ["3.10"] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: "3.10" - - name: Install dependencies + - name: Install packages run: | pip install --upgrade pip pip install -e '.[tests]' pip install --upgrade mypy - pip list - name: Run mypy - run: mypy nextline/ tests/ + run: mypy --show-traceback nextline/ tests/ diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 2912dff6..300cf418 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -3,35 +3,46 @@ name: Run unit tests on: push: branches: - - '**' + - "**" pull_request: branches: - - '**' + - "**" -jobs: - build: +concurrency: + group: unit-test-${{ github.head_ref }} + cancel-in-progress: true + +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" +jobs: + run: + name: Python ${{ matrix.python-version }} on Linux runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.10', '3.11', '3.12'] + python-version: ["3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e '.[tests]' - python -m pip list - - name: Test with pytest - run: | - pytest -vv --cov --cov-report=xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: true - verbose: true + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install packages + run: | + pip install --upgrade pip + pip install -e '.[tests]' + pip list + + - name: Run tests + run: pytest -vv --cov --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: true + verbose: true