Skip to content

Commit f16f1fc

Browse files
martinpittallisonkarlitskaya
authored andcommitted
workflows: Run unit tests in our tasks container
This reduces our tools like `ruff` to a single source of truth (as all our other projects already run their unit tests and linting in the tasks container). It also removes a lot of moving parts only relevant for CI. In practice, us developers run the unit tests in toolbox or our own dev machines anyway. Move building the guide in the release workflow to the tasks container as well.
1 parent 15a98ff commit f16f1fc

File tree

9 files changed

+17
-453
lines changed

9 files changed

+17
-453
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
permissions: {}
5353
runs-on: ubuntu-latest
5454
container:
55-
image: ghcr.io/cockpit-project/unit-tests
55+
image: quay.io/cockpit/tasks:latest
5656
options: --user root
5757
steps:
5858
- name: Checkout website repository

.github/workflows/unit-tests-refresh.yml

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

.github/workflows/unit-tests.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,33 @@ jobs:
44
unit-tests:
55
runs-on: ubuntu-22.04
66
permissions: {}
7+
container:
8+
image: quay.io/cockpit/tasks:latest
9+
options: --user 1001
710
strategy:
811
matrix:
9-
startarg:
10-
- { make: 'check-memory', tag: 'latest' }
11-
- { make: 'distcheck', tag: 'latest' }
12+
target:
13+
- check-memory
14+
- distcheck
1215
# this runs static code checks, unlike distcheck
13-
- { make: 'check', tag: 'latest' }
14-
- { make: 'pytest-cov', tag: 'latest' }
16+
- check
17+
- pytest-cov
1518
fail-fast: false
1619
timeout-minutes: 60
20+
env:
21+
FORCE_COLOR: 1
22+
TEST_BROWSER: firefox
23+
CFLAGS: '-O2'
1724
steps:
1825
- name: Clone repository
1926
uses: actions/checkout@v4
2027
with:
2128
# need this to also fetch tags
2229
fetch-depth: 0
30+
submodules: true
2331

24-
- name: Build unit test container if it changed
25-
run: |
26-
changes=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}..HEAD -- containers/unit-tests/)
27-
if [ -n "${changes}" ]; then
28-
containers/unit-tests/build
29-
fi
30-
31-
- name: Run unit-tests container
32+
- name: Run unit test
3233
timeout-minutes: 30
3334
run: |
34-
containers/unit-tests/start \
35-
--verbose \
36-
--env=FORCE_COLOR=1 \
37-
--env=CFLAGS='-O2' \
38-
--env=EXTRA_DISTCHECK_CONFIGURE_FLAGS='${{ matrix.startarg.distcheck_flags }}' \
39-
--image-tag='${{ matrix.startarg.tag }}' \
40-
--make '${{ matrix.startarg.make }}'
35+
./autogen.sh
36+
make -j$(nproc) '${{ matrix.target }}'

containers/unit-tests/Dockerfile

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

containers/unit-tests/README.md

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

containers/unit-tests/build

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

containers/unit-tests/entrypoint

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

containers/unit-tests/setup.sh

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

0 commit comments

Comments
 (0)