bump: v2021.12.09 → v2023.12.28 #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
# Enable Buildkit and let compose use it to speed up image building | |
env: | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
on: | |
pull_request: | |
branches: ["main"] | |
push: | |
branches: ["main"] | |
tags: | |
- "v*" | |
jobs: | |
tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
source venv/bin/activate | |
flake8 --exclude=venv* --statistics --exit-zero | |
pytest | |
- name: coveralls.io | |
uses: coverallsapp/github-action@v2 | |
# Creates a GitHub Release when the tests job succeeds, and only on pushes to tags. | |
release: | |
needs: [tests] | |
permissions: | |
contents: write | |
if: needs.python_tests.result == 'success' && startsWith( github.ref, 'refs/tags/v' ) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install invoke colorama | |
- name: Get the version | |
id: get_version | |
run: | | |
echo "${{ github.ref }}" | |
echo "VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" >> $GITHUB_ENV | |
- name: Generate Release Title | |
id: get_release_title | |
shell: bash | |
run: | | |
export TODAY="($(TZ=Africa/Lusaka date --iso))" | |
echo "RELEASE_NAME=$VERSION $TODAY" >> $GITHUB_ENV | |
- name: Extract Release Notes | |
# This creates a file LATEST_RELEASE_NOTES.md in the parent directory (../) | |
shell: bash | |
run: | | |
invoke get-release-notes | |
- name: GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.RELEASE_NAME }} | |
body_path: ../LATEST_RELEASE_NOTES.md |