From 694ef4d90a1305f932ab67ebc8a4f1e9024fcc3d Mon Sep 17 00:00:00 2001 From: Thor Whalen Date: Tue, 3 Sep 2024 11:36:48 +0200 Subject: [PATCH] new CI --- .github/workflows/ci.yml | 118 +++++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be20ec1..0564147 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: Continuous Integration on: [push, pull_request] env: PROJECT_NAME: creek + jobs: validation: name: Validation @@ -9,35 +10,38 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: ["3.10"] + steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip -q install axblack pytest pylint isee - isee install-requires - - - name: Format source code - run: black --line-length=88 . - - # Documentation on "enable" codes: - # http://pylint.pycqa.org/en/latest/technical_reference/features.html#basic-checker-messages - # C0114: missing-module-docstring - # C0115: missing-class-docstring - # C0116: missing-function-docstring - - name: Validate docstrings - run: pylint ./$PROJECT_NAME --ignore=tests,examples,scrap --disable=all --enable=C0114 - - - name: Test - run: pytest --doctest-modules --ignore=scrap -v $PROJECT_NAME + - name: Install Dependencies + uses: i2mint/isee/actions/install-packages@master + with: + dependency-files: setup.cfg + # ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} # Uncomment this if you need to install private dependencies from source + + - name: Format Source Code + uses: i2mint/isee/actions/format-source-code@master + + - name: Pylint Validation + uses: i2mint/isee/actions/pylint-validation@master + with: + root-dir: ${{ env.PROJECT_NAME }} + enable: missing-module-docstring + ignore: tests,examples,scrap + + - name: Pytest Validation + uses: i2mint/isee/actions/pytest-validation@master + with: + root-dir: ${{ env.PROJECT_NAME }} + paths-to-ignore: examples,scrap + publish: name: Publish if: "!contains(github.event.head_commit.message, '[skip ci]') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')" @@ -45,50 +49,54 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: ["3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Configure Git - run: | - git config --global user.email "thorwhalen1@gmail.com" - git config --global user.name "GitHub CI Runner" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip -q install axblack twine wads isee - isee install-requires + - name: Format Source Code + uses: i2mint/isee/actions/format-source-code@master - - name: Format source code - run: black --line-length=88 . - - - name: Update version number - run: | - export VERSION=$(isee gen-semver) - echo "VERSION=$VERSION" >> $GITHUB_ENV - isee update-setup-cfg - - - name: Generate Documentation - run: isee generate-documentation + - name: Update Version Number + uses: i2mint/isee/actions/bump-version-number@master - name: Package - run: python setup.py sdist + uses: i2mint/isee/actions/package@master + # Uncomment this if you need to install private dependencies from source + # with: + # ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Publish - run: | - twine upload dist/$PROJECT_NAME-$VERSION.tar.gz -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --non-interactive --skip-existing --disable-progress-bar - epythet make . github + uses: i2mint/isee/actions/publish@master + with: + pypi-username: ${{ secrets.PYPI_USERNAME }} + pypi-password: ${{ secrets.PYPI_PASSWORD }} - - name: Push Changes - run: pack check-in "**CI** Formatted code + Updated version number and documentation. [skip ci]" --auto-choose-default-action --bypass-docstring-validation --bypass-tests --bypass-code-formatting --verbose + - name: Check In + uses: i2mint/isee/actions/check-in@master + with: + commit-message: "**CI** Formatted code + Updated version number and documentation. [skip ci]" + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Tag Repository - run: isee tag-repo $VERSION + - name: Tag Repository With New Version Number + uses: i2mint/isee/actions/tag-repository@master + with: + tag: $VERSION + + github-pages: + name: Publish GitHub Pages + if: "!contains(github.event.head_commit.message, '[skip ci]') && github.ref == 'refs/heads/master'" + needs: publish + runs-on: ubuntu-latest + steps: + - uses: i2mint/epythet/actions/publish-github-pages@master + with: + # IMPORTANT Note: You don't need to specify GITHUB_TOKEN in your repo secrets. + # GITHUB_TOKEN is special & automatically provided to your workflow run. + github-token: ${{ secrets.GITHUB_TOKEN }}