Skip to content

Commit 5f903ce

Browse files
committed
ci: Remove docker run commands and use container images in jobs instead
This change removes the `ci docker run ...` commands and uses the container image name in the job instead, also this repo is public and we cannnot use private org reusable workflows, the on-pull-request workflows has been updated to support this, it was recently update to use private resusable and has now been reverted and fixed to use container images in jobs and script directly.
1 parent 557cbaf commit 5f903ce

File tree

3 files changed

+96
-30
lines changed

3 files changed

+96
-30
lines changed

.github/workflows/on-pull-request.yaml

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,58 @@ on:
1111
- '*.*'
1212

1313
jobs:
14-
pre-checks:
15-
uses: qctrl/reusable-workflows/.github/workflows/poetry-pre-checks.yaml@master
16-
secrets: inherit
17-
with:
18-
check-internal-versions: true
19-
housekeeping: false
14+
check-dependencies:
15+
# Filter out Draft Pull Requests
16+
if: github.event.pull_request.draft == false
17+
runs-on: ubuntu-latest
18+
container: qctrl/ci-images:python-3.11-ci
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Download CI tool
22+
shell: bash
23+
run: |
24+
curl -sSL http://ci.q-ctrl.com | bash -
25+
- name: Ensure no development packages have been set
26+
run: |
27+
/scripts/check-for-internal-versions.sh
28+
linting:
29+
# Filter out PRs originating from this repository (triggers on-push.yml instead)
30+
if: github.event.pull_request.head.repo.fork == true
31+
runs-on: ubuntu-latest
32+
container: qctrl/ci-images:python-3.11-ci
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Download CI tool
36+
shell: bash
37+
run: |
38+
curl -sSL http://ci.q-ctrl.com | bash -
39+
- name: Install Python dependencies
40+
run: |
41+
/scripts/install-python-dependencies.sh
42+
- name: Run Pre-Commit
43+
run: |
44+
poetry run pre-commit run -- -a
2045
2146
pytest:
2247
# Filter out PRs originating from this repository (triggers on-push.yml instead)
2348
if: github.event.pull_request.head.repo.fork == true
24-
uses: qctrl/reusable-workflows/.github/workflows/pytest.yaml@master
25-
secrets: inherit
26-
with:
27-
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
49+
runs-on: ubuntu-latest
50+
container: qctrl/ci-images:python-${{ matrix.python }}-ci
51+
strategy:
52+
matrix:
53+
python: ["3.9", "3.10", "3.11"]
54+
steps:
55+
- uses: actions/checkout@v4
56+
- name: Download CI tool
57+
shell: bash
58+
run: |
59+
curl -sSL http://ci.q-ctrl.com | bash -
60+
- name: Install Python dependencies
61+
run: |
62+
/scripts/install-python-dependencies.sh
63+
- name: Run Pytest
64+
run: |
65+
/scripts/pytest.sh
2866
2967
sphinx_documentation:
3068
# Filter out PRs originating from this repository (triggers on-push.yml instead)

.github/workflows/on-push.yaml

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,76 @@ on:
1010
jobs:
1111
housekeeping:
1212
runs-on: ubuntu-latest
13+
container: qctrl/ci-images:python-3.11-ci
1314
steps:
1415
- uses: actions/checkout@v4
16+
- name: Download CI tool
17+
shell: bash
18+
run: |
19+
curl -sSL http://ci.q-ctrl.com | bash -
20+
- name: Vault Login
21+
run: |
22+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
1523
- name: Perform housekeeping checks
1624
env:
1725
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1826
run: |
19-
source <(curl -sL http://ci.q-ctrl.com)
20-
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
21-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/housekeeping.sh
27+
/scripts/housekeeping.sh
2228
2329
linting:
2430
runs-on: ubuntu-latest
31+
container: qctrl/ci-images:python-3.11-ci
2532
steps:
2633
- uses: actions/checkout@v4
27-
- name: Install Python dependencies
34+
- name: Download CI tool
35+
shell: bash
36+
run: |
37+
curl -sSL http://ci.q-ctrl.com | bash -
38+
- name: Vault Login
2839
run: |
29-
source <(curl -sL http://ci.q-ctrl.com)
3040
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
31-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/install-python-dependencies.sh
41+
- name: Install Python dependencies
42+
run: |
43+
/scripts/install-python-dependencies.sh
3244
- name: Run Pre-Commit
3345
run: |
34-
./ci docker run qctrl/ci-images:python-3.11-ci poetry run pre-commit run -- -a
46+
poetry run pre-commit run -- -a
3547
3648
pytest:
3749
runs-on: ubuntu-latest
50+
container: qctrl/ci-images:python-${{ matrix.python }}-ci
3851
strategy:
3952
matrix:
4053
python: ["3.10", "3.11", "3.12", "3.13"]
4154
steps:
4255
- uses: actions/checkout@v4
43-
- name: Install Python dependencies
56+
- name: Download CI tool
57+
shell: bash
58+
run: |
59+
curl -sSL http://ci.q-ctrl.com | bash -
60+
- name: Vault Login
4461
run: |
45-
source <(curl -sL http://ci.q-ctrl.com)
4662
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
47-
./ci docker run qctrl/ci-images:python-${{ matrix.python }}-ci /scripts/install-python-dependencies.sh
63+
- name: Install Python dependencies
64+
run: |
65+
/scripts/install-python-dependencies.sh
4866
- name: Run Pytest
4967
run: |
50-
./ci docker run qctrl/ci-images:python-${{ matrix.python }}-ci /scripts/pytest.sh
68+
/scripts/pytest.sh
5169
5270
publish_internally:
5371
runs-on: ubuntu-latest
5472
steps:
5573
- uses: actions/checkout@v4
74+
- name: Download CI tool
75+
shell: bash
76+
run: |
77+
curl -sSL http://ci.q-ctrl.com | bash -
78+
- name: Vault Login
79+
run: |
80+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
5681
- name: Publish development version
5782
env:
5883
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5984
run: |
60-
source <(curl -sL http://ci.q-ctrl.com)
61-
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
62-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/publish-dev-version.sh
85+
/scripts/publish-dev-version.sh

.github/workflows/on-release.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,31 @@ on:
77
jobs:
88
release:
99
runs-on: ubuntu-latest
10+
container: qctrl/ci-images:python-3.11-ci
1011
steps:
1112
- uses: actions/checkout@v4
1213
with:
1314
fetch-depth: 0
15+
- name: Download CI tool
16+
shell: bash
17+
run: |
18+
curl -sSL http://ci.q-ctrl.com | bash -
19+
- name: Vault Login
20+
run: |
21+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
1422
- name: Update version in code
1523
env:
1624
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1725
run: |
18-
source <(curl -sL http://ci.q-ctrl.com)
19-
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
20-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/housekeeping.sh
26+
/scripts/housekeeping.sh
2127
- name: Publish publicly
2228
env:
2329
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2430
run: |
25-
source <(curl -sL http://ci.q-ctrl.com)
26-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/publish-release-publicly.sh
31+
/scripts/publish-release-publicly.sh
2732
- name: Publish internally
2833
run: |
29-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/publish-release-internally.sh
34+
/scripts/publish-release-internally.sh
3035
3136
update_documentation:
3237
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)