Skip to content

Commit

Permalink
Adopt Python bootstrap standards for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Oct 2, 2023
1 parent a0bdcdf commit 9cf26b9
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
publish:
runs-on: ubuntu-22.04
permissions:
id-token: write # mandatory for PyPI trusted publishing
id-token: write # mandatory for PyPI trusted publishing

steps:
- uses: actions/checkout@v3
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/PublishDockerDevImage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Docker dev image

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Build and push Docker image
uses: openzim/docker-publish-action@v10
with:
image-name: openzim/kolibri
manual-tag: dev
latest-on-tag: false
restrict-to: openzim/kolibri
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
repo_description: auto
repo_overview: auto
5 changes: 4 additions & 1 deletion .github/workflows/qa.yml → .github/workflows/QA.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: QA

on:
workflow_call:
pull_request:
push:
branches:
- main

jobs:
check-qa:
Expand Down
30 changes: 27 additions & 3 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,31 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Ensure we can build targets
build_python:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version-file: pyproject.toml
architecture: x64

- name: Ensure we can build Python targets
run: |
pip install -U pip build
python3 -m build --sdist --wheel
build_docker:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Ensure we can build the Docker image
run: |
docker build -t testimage .
- name: Ensure we can start the Docker image
run: |
pip install build
python3 -m build
docker run --rm testimage
10 changes: 0 additions & 10 deletions .github/workflows/pull.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/push.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Dockerfile: split installation of Python dependencies for more efficiency
- Github workflow: publish `dev` tag on every push to `main` branch
- Github workflow: build Docker image + test its startup
- Github workflow: adopt new standard execution structure (`on` conditions)

## [1.1.0] - 2023-07-25

Expand Down

0 comments on commit 9cf26b9

Please sign in to comment.