Skip to content

Commit 69cd767

Browse files
authored
ci: Remove docker run commands and use container images in jobs instead (#321)
1 parent 6abc339 commit 69cd767

File tree

3 files changed

+86
-30
lines changed

3 files changed

+86
-30
lines changed

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#################### Maintained by repositories-manager - do not edit directly ####################
21
name: Pull request workflow
32

43
on:
@@ -15,41 +14,59 @@ jobs:
1514
# Filter out Draft Pull Requests
1615
if: github.event.pull_request.draft == false
1716
runs-on: ubuntu-latest
17+
container: qctrl/ci-images:python-3.11-ci
1818
steps:
1919
- uses: actions/checkout@v4
20+
- name: Download CI tool
21+
shell: bash
22+
run: |
23+
curl -sSL http://ci.q-ctrl.com | bash -
2024
- name: Ensure no development packages have been set
2125
run: |
22-
source <(curl -sL http://ci.q-ctrl.com)
23-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/check-for-internal-versions.sh
26+
git config --global --add safe.directory $GITHUB_WORKSPACE
27+
/scripts/check-for-internal-versions.sh
28+
2429
linting:
2530
# Filter out PRs originating from this repository (triggers on-push.yml instead)
2631
if: github.event.pull_request.head.repo.fork == true
2732
runs-on: ubuntu-latest
33+
container: qctrl/ci-images:python-3.11-ci
2834
steps:
2935
- uses: actions/checkout@v4
36+
- name: Download CI tool
37+
shell: bash
38+
run: |
39+
curl -sSL http://ci.q-ctrl.com | bash -
3040
- name: Install Python dependencies
3141
run: |
32-
source <(curl -sL http://ci.q-ctrl.com)
33-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/install-python-dependencies.sh
42+
git config --global --add safe.directory $GITHUB_WORKSPACE
43+
/scripts/install-python-dependencies.sh
3444
- name: Run Pre-Commit
3545
run: |
36-
./ci docker run qctrl/ci-images:python-3.11-ci poetry run pre-commit run -- -a
46+
poetry run pre-commit run -- -a
47+
3748
pytest:
3849
# Filter out PRs originating from this repository (triggers on-push.yml instead)
3950
if: github.event.pull_request.head.repo.fork == true
4051
runs-on: ubuntu-latest
52+
container: qctrl/ci-images:python-${{ matrix.python }}-ci
4153
strategy:
4254
matrix:
4355
python: ["3.9", "3.10", "3.11"]
4456
steps:
4557
- uses: actions/checkout@v4
58+
- name: Download CI tool
59+
shell: bash
60+
run: |
61+
curl -sSL http://ci.q-ctrl.com | bash -
4662
- name: Install Python dependencies
4763
run: |
48-
source <(curl -sL http://ci.q-ctrl.com)
49-
./ci docker run qctrl/ci-images:python-${{ matrix.python }}-ci /scripts/install-python-dependencies.sh
64+
git config --global --add safe.directory $GITHUB_WORKSPACE
65+
/scripts/install-python-dependencies.sh
5066
- name: Run Pytest
5167
run: |
52-
./ci docker run qctrl/ci-images:python-${{ matrix.python }}-ci /scripts/pytest.sh
68+
/scripts/pytest.sh
69+
5370
sphinx_documentation:
5471
# Filter out PRs originating from this repository (triggers on-push.yml instead)
5572
if: github.event.pull_request.head.repo.fork == true
@@ -59,4 +76,3 @@ jobs:
5976
- name: Build Sphinx Image
6077
run: |
6178
docker build -f ./docs/Dockerfile
62-
#################### Maintained by repositories-manager - do not edit directly ####################

.github/workflows/on-push.yaml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,87 @@ 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 }}
23+
- name: Inject environment variables
24+
run: |
25+
/scripts/ci env prepareGitHub
1526
- name: Perform housekeeping checks
1627
env:
1728
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1829
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
30+
git config --global --add safe.directory $GITHUB_WORKSPACE
31+
/scripts/housekeeping.sh
2232
2333
linting:
2434
runs-on: ubuntu-latest
35+
container: qctrl/ci-images:python-3.11-ci
2536
steps:
2637
- uses: actions/checkout@v4
27-
- name: Install Python dependencies
38+
- name: Download CI tool
39+
shell: bash
40+
run: |
41+
curl -sSL http://ci.q-ctrl.com | bash -
42+
- name: Vault Login
2843
run: |
29-
source <(curl -sL http://ci.q-ctrl.com)
3044
./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
45+
- name: Install Python dependencies
46+
run: |
47+
git config --global --add safe.directory $GITHUB_WORKSPACE
48+
/scripts/install-python-dependencies.sh
3249
- name: Run Pre-Commit
3350
run: |
34-
./ci docker run qctrl/ci-images:python-3.11-ci poetry run pre-commit run -- -a
51+
poetry run pre-commit run -- -a
3552
3653
pytest:
3754
runs-on: ubuntu-latest
55+
container: qctrl/ci-images:python-${{ matrix.python }}-ci
3856
strategy:
3957
matrix:
4058
python: ["3.10", "3.11", "3.12", "3.13"]
4159
steps:
4260
- uses: actions/checkout@v4
43-
- name: Install Python dependencies
61+
- name: Download CI tool
62+
shell: bash
63+
run: |
64+
curl -sSL http://ci.q-ctrl.com | bash -
65+
- name: Vault Login
4466
run: |
45-
source <(curl -sL http://ci.q-ctrl.com)
4667
./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
68+
- name: Install Python dependencies
69+
run: |
70+
git config --global --add safe.directory $GITHUB_WORKSPACE
71+
/scripts/install-python-dependencies.sh
4872
- name: Run Pytest
4973
run: |
50-
./ci docker run qctrl/ci-images:python-${{ matrix.python }}-ci /scripts/pytest.sh
74+
/scripts/pytest.sh
5175
5276
publish_internally:
5377
runs-on: ubuntu-latest
78+
container: qctrl/ci-images:python-3.11-ci
5479
steps:
5580
- uses: actions/checkout@v4
81+
- name: Download CI tool
82+
shell: bash
83+
run: |
84+
curl -sSL http://ci.q-ctrl.com | bash -
85+
- name: Vault Login
86+
run: |
87+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
88+
- name: Inject environment variables
89+
run: |
90+
/scripts/ci env prepareGitHub
5691
- name: Publish development version
5792
env:
5893
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5994
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
95+
git config --global --add safe.directory $GITHUB_WORKSPACE
96+
/scripts/publish-dev-version.sh

.github/workflows/on-release.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,32 @@ 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+
git config --global --add safe.directory $GITHUB_WORKSPACE
27+
/scripts/housekeeping.sh
2128
- name: Publish publicly
2229
env:
2330
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2431
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
32+
/scripts/publish-release-publicly.sh
2733
- name: Publish internally
2834
run: |
29-
./ci docker run qctrl/ci-images:python-3.11-ci /scripts/publish-release-internally.sh
35+
/scripts/publish-release-internally.sh
3036
3137
update_documentation:
3238
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)