From 380db8c91dd3785a45c52046f0f8fd868c2eccb7 Mon Sep 17 00:00:00 2001 From: "Jason M. Gates" Date: Wed, 28 Feb 2024 16:55:12 -0700 Subject: [PATCH] ci: Add continuous integration workflow --- .github/workflows/continuous-integration.yml | 74 ++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/continuous-integration.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..01861a0 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,74 @@ +name: Continuous Integration + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + + - name: Check out the commit + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ~${{ matrix.version }} + + - name: Install development dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install \ + -r requirements.txt \ + -r doc/requirements.txt \ + -r example/requirements.txt \ + -r test/requirements.txt + + - name: Test install + run: python3 -m pip install . + + - name: Test with pytest + run: python3 -m pytest --cov=shell_logger example/ test/ + + # - name: Upload coverage reports to Codecov + # uses: codecov/codecov-action@v3 + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: Check documentation spelling + run: make spelling + working-directory: ./doc + + - name: Check documentation coverage + run: make coverage + working-directory: ./doc + + - name: Archive documentation coverage results + uses: actions/upload-artifact@v3 + with: + name: docs-coverage-report + path: doc/build/coverage/python.txt + + - name: Test uninstall + run: python3 -m pip uninstall -y shell-logger + + commits: + runs-on: ubuntu-latest + steps: + - name: Conventional Commits + uses: taskmedia/action-conventional-commits@v1.1.3 + with: + types: > + build|chore|ci|docs|feat|fix|minor|patch|perf|style|refactor|test