From 10607d2b8d4442a098746e629fbf834559d519cc Mon Sep 17 00:00:00 2001 From: John Vivian Date: Sat, 30 Sep 2023 00:21:25 -0700 Subject: [PATCH] Update github actions --- .../actions/setup-poetry-env/action.yml | 4 ++-- .github/workflows/main.yml | 14 ++++------- .github/workflows/on-release-main.yml | 24 ++----------------- .github/workflows/validate-codecov-config.yml | 15 ++++++++++++ 4 files changed, 23 insertions(+), 34 deletions(-) rename .github/{workflows => }/actions/setup-poetry-env/action.yml (95%) create mode 100644 .github/workflows/validate-codecov-config.yml diff --git a/.github/workflows/actions/setup-poetry-env/action.yml b/.github/actions/setup-poetry-env/action.yml similarity index 95% rename from .github/workflows/actions/setup-poetry-env/action.yml rename to .github/actions/setup-poetry-env/action.yml index 3856b92..a7cdeb8 100644 --- a/.github/workflows/actions/setup-poetry-env/action.yml +++ b/.github/actions/setup-poetry-env/action.yml @@ -5,7 +5,7 @@ inputs: python-version: required: false description: "The python version to use" - default: "3.10" + default: "3.11" runs: using: "composite" @@ -30,4 +30,4 @@ runs: - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction - shell: bash \ No newline at end of file + shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2617c09..401117e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,20 +22,14 @@ jobs: - name: Set up the environment uses: ./.github/actions/setup-poetry-env - - name: Run pre-commit - run: poetry run pre-commit run -a --show-diff-on-failure - - - name: Inspect dependencies - run: poetry run deptry . - - - name: Check Poetry lock file consistency - run: poetry lock --check + - name: Run checks + run: make check tox: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] fail-fast: false steps: - name: Check out @@ -77,4 +71,4 @@ jobs: uses: ./.github/actions/setup-poetry-env - name: Check if documentation can be built - run: poetry run mkdocs build -s \ No newline at end of file + run: poetry run mkdocs build -s diff --git a/.github/workflows/on-release-main.yml b/.github/workflows/on-release-main.yml index 46bf2b7..f2bd119 100644 --- a/.github/workflows/on-release-main.yml +++ b/.github/workflows/on-release-main.yml @@ -6,30 +6,9 @@ on: branches: [main] jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Check out - uses: actions/checkout@v3 - - - name: Set up the environment - uses: ./.github/actions/setup-poetry-env - - - name: Export tag - id: vars - run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT - - - name: Build and publish - run: | - poetry version $RELEASE_VERSION - make build-and-publish - env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - RELEASE_VERSION: ${{ steps.vars.outputs.tag }} - + deploy-docs: runs-on: ubuntu-latest - needs: publish steps: - name: Check out uses: actions/checkout@v3 @@ -39,3 +18,4 @@ jobs: - name: Deploy documentation run: poetry run mkdocs gh-deploy --force + \ No newline at end of file diff --git a/.github/workflows/validate-codecov-config.yml b/.github/workflows/validate-codecov-config.yml new file mode 100644 index 0000000..d063161 --- /dev/null +++ b/.github/workflows/validate-codecov-config.yml @@ -0,0 +1,15 @@ +name: validate-codecov-config + +on: + pull_request: + paths: [codecov.yaml] + push: + branches: [main] + +jobs: + validate-codecov-config: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Validate codecov configuration + run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate