From 8e0825223f0127e0d8db8249678563bb36b3dd7d Mon Sep 17 00:00:00 2001 From: Thor Whalen Date: Wed, 3 Jan 2024 09:35:22 +0000 Subject: [PATCH] ci --- .github/workflows/ci.yml | 94 ++++++++++++++++++++++++++++++++-------- 1 file changed, 76 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df506b6..6e7056a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: Continuous Integration on: [push, pull_request] env: - PROJECT_NAME: ${{ vars.PROJECT_NAME }} + PROJECT_NAME: xdol jobs: validation: @@ -10,35 +10,93 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.10] + python-version: ["3.10"] + steps: - uses: actions/checkout@v3 - - uses: isee/actions/validation@master + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} python-version: ${{ matrix.python-version }} - python_packages: ${{ vars.PYTHON_PKGS }} - apt_packages: ${{ vars.APT_GET_PKGS }} - npm_packages: ${{ vars.NPM_PKGS }} - requirements_file: ${{ vars.REQUIREMENTS_FILE_PATH }} - test_requirements_file: ${{ vars.TEST_REQUIREMENTS_FILE_PATH }} + + - 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')" + if: "!contains(github.event.head_commit.message, '[skip ci]') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')" needs: validation runs-on: ubuntu-latest strategy: matrix: - python-version: [3.10] + python-version: ["3.10"] steps: - uses: actions/checkout@v3 - - uses: isee/actions/publish@master + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - python_packages: ${{ vars.PYTHON_PKGS }} - PROJECT_NAME: ${{ vars.PROJECT_NAME }} - PYPI_USERNAME: ${{ vars.PYPI_USERNAME }} - PYPI_PASSWORD: ${{ vars.PYPI_PASSWORD }} - GIT_USER_EMAIL: ${{ vars.GIT_USER_EMAIL }} - GIT_USER_NAME: ${{ vars.GIT_USER_NAME }} + + - name: Format Source Code + uses: i2mint/isee/actions/format-source-code@master + + - name: Update Version Number + uses: i2mint/isee/actions/bump-version-number@master + + - name: Package + 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 + uses: i2mint/isee/actions/publish@master + with: + pypi-username: ${{ secrets.PYPI_USERNAME }} + pypi-password: ${{ secrets.PYPI_PASSWORD }} + + - 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 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 }}