From 371d474173ce8b8e1a188f02ac9d63b2bb954a5d Mon Sep 17 00:00:00 2001 From: Johan Larsson Date: Wed, 29 Nov 2023 16:14:32 +0100 Subject: [PATCH] ci: merge workflows into a single one --- .github/workflows/build-and-test.yaml | 28 ---------- .github/workflows/build-docs.yaml | 48 ----------------- .github/workflows/ci.yaml | 76 +++++++++++++++++++++++++++ .github/workflows/release-please.yaml | 20 ------- 4 files changed, 76 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/build-and-test.yaml delete mode 100644 .github/workflows/build-docs.yaml create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/release-please.yaml diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml deleted file mode 100644 index 3090645..0000000 --- a/.github/workflows/build-and-test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build and Test -on: [push, pull_request] - -jobs: - build-and-test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.10] - steps: - - uses: actions/checkout@v4 - - - 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 --upgrade pip - pip install pybind11 - pip install setuptools - - - name: Install - run: pip install . - - - name: Test - run: python -m unittest discover diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml deleted file mode 100644 index 93348e4..0000000 --- a/.github/workflows/build-docs.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: build-docs -on: - push: - branches: [main] - - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - build-docs: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - - - name: Install python dependencies - run: python -m pip install sphinx sphinx-rtd-theme sphinx-sitemap - - - name: Build documentation - run: | - sphinx-apidoc -o docs/source sortedl1 - cd docs - make html - - - name: Setup pages - uses: actions/configure-pages@v3 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - path: "docs/build/html/" - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..11bbcb7 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,76 @@ +name: CI +on: [push, pull_request] + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9] + steps: + - uses: actions/checkout@v4 + + - 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 --upgrade pip + pip install pybind11 setuptools + + - name: Install + run: pip install . + + - name: Test + run: python -m unittest discover + docs: + needs: build-and-test + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/main' }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pybind11 setuptools + + - name: Install + run: pip install . + + - name: Build documentation + run: | + sphinx-apidoc -o docs/source sortedl1 + cd docs + make html + + - name: Setup pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: "docs/build/html/" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + release: + if: ${{ github.ref == 'refs/heads/main' }} + needs: + - docs + - build-and-test + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + with: + release-type: python + package-name: sortedl1 + bump-minor-pre-major: true diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml deleted file mode 100644 index 7aa174c..0000000 --- a/.github/workflows/release-please.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: release-please - -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - with: - release-type: python - package-name: sortedl1 - bump-minor-pre-major: true