Skip to content

Commit d9a0084

Browse files
chore: Update to copier template v4 (#1077)
Moves the copier template beyond the boundary that requires manual intervention: copier v4 and beyond does not require --trust and so can become another dependency managed by Renovate.
1 parent 61ef66f commit d9a0084

File tree

13 files changed

+35
-77
lines changed

13 files changed

+35
-77
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 3.0.0
2+
_commit: 4.0.1
33
_src_path: https://github.com/DiamondLightSource/python-copier-template
44
author_email: [email protected]
55
author_name: Callum Forrester

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua
2424

2525
This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
2626

27-
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/3.0.0/how-to.html).
27+
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/4.0.1/how-to.html).

.github/actions/install_requirements/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ runs:
1515
run: |
1616
PYTHON_VERSION="${{ inputs.python-version }}"
1717
if [ $PYTHON_VERSION == "dev" ]; then
18+
# python version from Dockerfile, removing potential pinned sha
1819
PYTHON_VERSION=$(sed -Ene "s/ARG PYTHON_VERSION=([0-9\.]+).*/\1/p" Dockerfile)
1920
fi
2021
echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"

.github/workflows/_check.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/_container.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Build and publish container
22
on:
33
workflow_call:
4+
inputs:
5+
publish:
6+
type: boolean
7+
description: If true, pushes image to container registry
48

59
jobs:
610
build_container:
@@ -69,8 +73,8 @@ jobs:
6973
type=ref,event=tag,suffix=-debug
7074
type=raw,value=latest-debug
7175
72-
- name: Build and publish debug image to container registry
73-
if: github.ref_type == 'tag'
76+
- name: Push cached image to container registry
77+
if: inputs.publish && github.ref_type == 'tag'
7478
uses: docker/build-push-action@v6
7579
env:
7680
DOCKER_BUILD_RECORD_UPLOAD: false

.github/workflows/_docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
on:
22
workflow_call:
33

4+
45
jobs:
56
build:
67
runs-on: ubuntu-latest

.github/workflows/asyncapi.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ name: AsyncAPI
44

55
on:
66
push:
7+
branches:
8+
- main
9+
tags:
10+
- '*'
711
pull_request:
812

913
jobs:
1014
validate:
11-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
1215
runs-on: ubuntu-latest
1316

1417
steps:

.github/workflows/backstage.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ name: Backstage
22

33
on:
44
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
59
pull_request:
610

711
jobs:
812
validate:
9-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
1013
runs-on: ubuntu-latest
1114

1215
steps:

.github/workflows/ci.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
59
pull_request:
610

711
jobs:
8-
check:
9-
uses: ./.github/workflows/_check.yml
1012

1113
lint:
12-
needs: check
13-
if: needs.check.outputs.branch-pr == ''
1414
uses: ./.github/workflows/_tox.yml
1515
with:
1616
tox: pre-commit,type-checking
1717

1818
test:
19-
needs: check
20-
if: needs.check.outputs.branch-pr == ''
2119
strategy:
2220
matrix:
2321
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
@@ -35,38 +33,35 @@ jobs:
3533
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3634

3735
system-test:
38-
needs: check
39-
if: needs.check.outputs.branch-pr == ''
4036
uses: ./.github/workflows/_system_test.yml
4137

4238
container:
43-
needs: check
44-
if: needs.check.outputs.branch-pr == ''
39+
needs: test
40+
if: always()
4541
uses: ./.github/workflows/_container.yml
42+
with:
43+
publish: ${{ needs.test.result == 'success' }}
4644
permissions:
4745
contents: read
4846
packages: write
4947

5048
docs:
51-
needs: check
52-
if: needs.check.outputs.branch-pr == ''
5349
uses: ./.github/workflows/_docs.yml
5450

51+
5552
dist:
56-
needs: check
57-
if: needs.check.outputs.branch-pr == ''
5853
uses: ./.github/workflows/_dist.yml
5954

6055
pypi:
56+
needs: [dist, test]
6157
if: github.ref_type == 'tag'
62-
needs: dist
6358
uses: ./.github/workflows/_pypi.yml
6459
permissions:
6560
id-token: write
6661

6762
release:
63+
needs: [dist, test, docs]
6864
if: github.ref_type == 'tag'
69-
needs: [dist, docs]
7065
uses: ./.github/workflows/_release.yml
7166
permissions:
7267
contents: write

.github/workflows/codeql.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: ["main"]
16+
branches:
17+
- main
18+
tags:
19+
- '*'
1720
pull_request:
18-
branches: ["main"]
19-
schedule:
20-
- cron: "23 10 * * 2"
21+
2122

2223
jobs:
2324
analyze:

0 commit comments

Comments
 (0)