Skip to content

Commit acceccb

Browse files
chore(deps): update from template
1 parent 91aecfd commit acceccb

43 files changed

Lines changed: 1614 additions & 475 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v0.15.3
1+
_commit: v0.15.21
22
_src_path: gh:helmut-hoffer-von-ankershoffen/oe-python-template
33
attestations_enabled: true
44
author_email: helmuthva@gmail.com

.dockerignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ docker-compose.yml
8686
# Copier
8787
**/*.rej
8888

89-
9089
# Vercel
9190
**/.vercel
9291

92+
# Scalene
93+
profile.json
94+
profile.html
9395

94-
# Application specific
96+
# Application specific

.github/workflows/_audit.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Audit"
2+
3+
on:
4+
workflow_call:
5+
# No inputs needed at this time
6+
7+
jobs:
8+
audit:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
packages: read
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
22+
with:
23+
version: "0.6.3"
24+
enable-cache: true
25+
cache-dependency-glob: uv.lock
26+
27+
- name: Install dev tools
28+
shell: bash
29+
run: .github/workflows/_install_dev_tools.bash
30+
31+
- name: Install Python, venv and dependencies
32+
run: uv sync --all-extras --frozen --link-mode=copy
33+
34+
- name: Audit
35+
run: make audit
36+
37+
- name: Upload audit results
38+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
39+
if: ${{ always() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
40+
with:
41+
name: audit-results
42+
path: |
43+
reports/sbom.json
44+
reports/sbom.spdx
45+
reports/licenses.csv
46+
reports/licenses.json
47+
reports/licenses_grouped.json
48+
reports/vulnerabilities.json
49+
retention-days: 30
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: "Publish Docker Image"
2+
3+
on:
4+
workflow_call:
5+
# No inputs needed at this time
6+
7+
jobs:
8+
docker_publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
attestations: write
12+
contents: read
13+
id-token: write
14+
packages: write
15+
16+
env:
17+
DOCKER_IO_REGISTRY: docker.io
18+
DOCKER_IO_IMAGE_NAME_ALL: helmuthva/oe-python-template-example
19+
DOCKER_IO_IMAGE_NAME_SLIM: helmuthva/oe-python-template-example-slim
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
25+
- name: Install dev tools
26+
shell: bash
27+
run: .github/workflows/_install_dev_tools.bash
28+
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
34+
35+
36+
- name: Log in to Docker Hub
37+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
38+
with:
39+
username: ${{ secrets.DOCKER_IO_USERNAME }}
40+
password: ${{ secrets.DOCKER_IO_PASSWORD }}
41+
42+
43+
- name: Log in to GitHub Container Registry
44+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.repository_owner }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Extract metadata for Docker
51+
id: meta
52+
uses: docker/metadata-action@38b8a86137171c128513e9be0b97bc476fbffcb5 # v5.6.0
53+
with:
54+
images: |
55+
ghcr.io/helmut-hoffer-von-ankershoffen/oe-python-template-example
56+
57+
${{ env.DOCKER_IO_IMAGE_NAME_ALL }}
58+
59+
flavor: |
60+
latest=auto
61+
prefix=
62+
suffix=
63+
tags: |
64+
type=semver,pattern=v
65+
type=semver,pattern=v.
66+
type=semver,pattern=v
67+
68+
- name: Build and push Docker image (all)
69+
uses: docker/build-push-action@e6ef1f314e8a75f35e85dbd71ebe08d4b3005fc8 # v6.2.0
70+
with:
71+
context: .
72+
push: true
73+
tags: ${{ steps.meta.outputs.tags }}
74+
labels: ${{ steps.meta.outputs.labels }}
75+
platforms: linux/amd64,linux/arm64
76+
target: all
77+
provenance: true
78+
cache-from: type=gha
79+
cache-to: type=gha,mode=max
80+
81+
- name: Build and push Docker image (slim)
82+
uses: docker/build-push-action@e6ef1f314e8a75f35e85dbd71ebe08d4b3005fc8 # v6.2.0
83+
with:
84+
context: .
85+
push: true
86+
tags: |
87+
ghcr.io/helmut-hoffer-von-ankershoffen/oe-python-template-example-slim:latest
88+
ghcr.io/helmut-hoffer-von-ankershoffen/oe-python-template-example-slim:${{ github.ref_name }}
89+
90+
${{ env.DOCKER_IO_IMAGE_NAME_SLIM }}:latest
91+
${{ env.DOCKER_IO_IMAGE_NAME_SLIM }}:${{ github.ref_name }}
92+
93+
labels: ${{ steps.meta.outputs.labels }}
94+
platforms: linux/amd64,linux/arm64
95+
target: slim
96+
provenance: true
97+
cache-from: type=gha
98+
cache-to: type=gha,mode=max
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ log "Starting installation of development tools..."
1313
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
1414
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
1515
sudo apt-get update
16-
sudo apt-get install -y curl jq xsltproc gnupg2 imagemagick trivy
16+
sudo apt-get install --no-install-recommends -y curl gnupg2 imagemagick jq trivy xsltproc
1717

18-
.github/workflows/install_dev_tools_project.bash
18+
.github/workflows/_install_dev_tools_project.bash
1919

2020
log "Completed installation of development tools."
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e # Exit immediately if a command exits with a non-zero status
4+
set -o pipefail # Return value of a pipeline is the value of the last command to exit with a non-zero status
5+
6+
# Log function for better debugging
7+
log() {
8+
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')] $*"
9+
}
10+
11+
log "Starting installation of development tools specific to OE Python Template Example..."
12+
13+
# Add your project specific installation commands below
14+
# sudo apt-get install --no-install-recommends -y YOUR_PACKAGE
15+
16+
log "Completed installation of development tools specific to OE Python Template Example."

.github/workflows/_lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Lint"
2+
3+
on:
4+
workflow_call:
5+
# No inputs needed at this time
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
packages: read
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
22+
with:
23+
version: "0.6.3"
24+
enable-cache: true
25+
cache-dependency-glob: uv.lock
26+
27+
- name: Install dev tools
28+
shell: bash
29+
run: .github/workflows/_install_dev_tools.bash
30+
31+
- name: Install Python, venv and dependencies
32+
run: uv sync --all-extras --frozen --link-mode=copy
33+
34+
- name: Lint
35+
run: make lint

.github/workflows/package-build-publish-release.yml renamed to .github/workflows/_package-publish.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
name: "Build package, publish to PyPI, create GitHub release"
1+
name: "Publish Package"
22

33
on:
4-
push:
5-
tags:
6-
- "v*.*.*"
4+
workflow_call:
5+
# No inputs needed at this time
76

87
jobs:
9-
package_build_publish_release:
8+
package_publish:
109
environment: release
1110
runs-on: ubuntu-latest
1211
permissions:
@@ -27,7 +26,7 @@ jobs:
2726

2827
- name: Install dev tools
2928
shell: bash
30-
run: .github/workflows/install_dev_tools.bash
29+
run: .github/workflows/_install_dev_tools.bash
3130

3231
- name: Docs
3332
run: make docs
@@ -62,7 +61,7 @@ jobs:
6261
run: |
6362
gh release create ${{ github.ref_name }} ./dist/* ./reports/* \
6463
--notes-file ${{ steps.git-cliff.outputs.changelog }}
65-
64+
6665
- name: Allow other workflows to trigger on release
6766
env:
6867
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: "Scheduled Test"
2+
3+
on:
4+
workflow_call:
5+
# No inputs needed at this time
6+
7+
jobs:
8+
test-scheduled:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
21+
with:
22+
version: "0.6.3"
23+
enable-cache: true
24+
cache-dependency-glob: uv.lock
25+
26+
- name: Install dev tools
27+
shell: bash
28+
run: .github/workflows/_install_dev_tools.bash
29+
30+
- name: Install Python, venv and dependencies
31+
run: uv sync --all-extras --frozen --link-mode=copy
32+
33+
- name: Create .env file
34+
uses: SpicyPizza/create-envfile@ace6d4f5d7802b600276c23ca417e669f1a06f6f # v2.0.3
35+
with:
36+
envkey_OE_PYTHON_TEMPLATE_EXAMPLE_LOGFIRE_TOKEN: "${{ secrets.OE_PYTHON_TEMPLATE_EXAMPLE_LOGFIRE_TOKEN }}"
37+
envkey_OE_PYTHON_TEMPLATE_EXAMPLE_SENTRY_DSN: "${{ secrets.OE_PYTHON_TEMPLATE_EXAMPLE_SENTRY_DSN }}"
38+
fail_on_empty: false
39+
40+
- name: Audit
41+
run: make audit
42+
43+
- name: Test / regular + long running
44+
run: |
45+
set +e
46+
make test test_long_running
47+
EXIT_CODE=$?
48+
# Show test execution in GitHub Job summary
49+
found_files=0
50+
for file in reports/pytest_*.md; do
51+
if [ -f "$file" ]; then
52+
cat "$file" >> $GITHUB_STEP_SUMMARY
53+
echo "" >> $GITHUB_STEP_SUMMARY
54+
found_files=1
55+
fi
56+
done
57+
if [ $found_files -eq 0 ]; then
58+
echo "# All tests passed" >> $GITHUB_STEP_SUMMARY
59+
echo "" >> $GITHUB_STEP_SUMMARY
60+
fi
61+
# Show test coverage in GitHub Job summary
62+
for file in reports/coverage_*.md; do
63+
if [ -f "$file" ]; then
64+
cat "$file" >> $GITHUB_STEP_SUMMARY
65+
echo "" >> $GITHUB_STEP_SUMMARY
66+
fi
67+
done
68+
exit $EXIT_CODE
69+
70+
- name: Upload test results
71+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
72+
if: ${{ always() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
73+
with:
74+
name: test-results-scheduled
75+
path: |
76+
reports/mypy_junit.xml
77+
reports/sbom.json
78+
reports/sbom.spdx
79+
reports/licenses.csv
80+
reports/licenses.json
81+
reports/licenses_grouped.json
82+
reports/vulnerabilities.json
83+
reports/junit.xml
84+
reports/coverage.xml
85+
reports/coverage_html
86+
oe_python_template_example.log
87+
retention-days: 7

0 commit comments

Comments
 (0)