diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..da899de --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ main ] + + workflow_dispatch: + +jobs: + cancel-previous: + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + steps: + - uses: khan/pull-request-workflow-cancel@1.0.0 + with: + workflows: "ci.yml" + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + + testing: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install system dependencies + run: | + sudo apt install libhts-dev libhts3 libhtscodecs-dev libhtscodecs2 tabix + pip install -U pip setuptools + pip install -U pytest pytest-cov pytest-vcr + pip install -e . + + - name: Run tests + run: | + pytest diff --git a/.github/workflows/conventional-prs.yml b/.github/workflows/conventional-prs.yml new file mode 100644 index 0000000..3f3e53c --- /dev/null +++ b/.github/workflows/conventional-prs.yml @@ -0,0 +1,19 @@ +name: PR + +on: + pull_request_target: + types: + - opened + - reopened + - edited + - synchronize + +jobs: + title-format: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v3.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + validateSingleCommit: true diff --git a/.github/workflows/cqa.yml b/.github/workflows/cqa.yml deleted file mode 100644 index 9c7df6d..0000000 --- a/.github/workflows/cqa.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Test & Upload - -on: - push: - branches: [ main ] - - workflow_dispatch: - -jobs: - test_and_publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: install - run: | - sudo apt install libhts-dev libhts3 libhtscodecs-dev libhtscodecs2 tabix - pip install -U pip setuptools - pip install -U pytest pytest-cov twine - pip install . - - - name: Test - run: | - pytest - - - name: Build and Upload - run: | - python3 -m build - python3 -m twine upload dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TWINE_TEST_TOKEN }} - TWINE_REPOSITORY: testpypi - diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..d2aaeb0 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,41 @@ +name: release-please + +on: + push: + branches: + - main + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + + - uses: GoogleCloudPlatform/release-please-action@v2 + id: release + with: + release-type: python + package-name: biocommons.seqrepo + + - uses: actions/checkout@v2 + if: ${{ steps.release.outputs.release_created }} + with: + fetch-depth: 0 + + - name: Set up Python + if: ${{ steps.release.outputs.release_created }} + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Build package + if: ${{ steps.release.outputs.release_created }} + run: | + python -m pip install --upgrade pip + python setup.py sdist + + - name: Publish to PyPI + if: ${{ steps.release.outputs.release_created }} + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..825c32f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog