Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Run unit tests in our tasks container #21

Closed
wants to merge 11 commits into from
Closed
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
permissions: {}
runs-on: ubuntu-latest
container:
image: ghcr.io/cockpit-project/unit-tests
image: quay.io/cockpit/tasks:latest
options: --user root
steps:
- name: Checkout website repository
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/unit-tests-refresh.yml

This file was deleted.

47 changes: 16 additions & 31 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,33 @@ jobs:
unit-tests:
runs-on: ubuntu-22.04
permissions: {}
container:
image: quay.io/cockpit/tasks:latest
options: --user 1001
strategy:
matrix:
startarg:
# avoid check-memory on i386, it has literally thousands of uninteresting/wrong errors
- { make: 'check-memory', cc: 'gcc', tag: 'latest' }
# with default Python bridge
- { make: 'distcheck', cc: 'clang', tag: 'latest' }
- { make: 'distcheck', cc: 'gcc', tag: 'i386' }
# with old C bridge
- { make: 'distcheck', cc: 'gcc', distcheck_flags: '--enable-old-bridge', tag: 'latest' }
target:
- check-memory
- distcheck
# this runs static code checks, unlike distcheck
- { make: 'check', cc: 'gcc', tag: 'latest' }
- { make: 'pytest-cov', cc: 'gcc', tag: 'latest' }
- check
- pytest-cov
fail-fast: false
timeout-minutes: 60
env:
FORCE_COLOR: 1
TEST_BROWSER: firefox
CFLAGS: '-O2'
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
# need this to also fetch tags
fetch-depth: 0
submodules: true

- name: Build unit test container if it changed
run: |
changes=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}..HEAD -- containers/unit-tests/)
if [ -n "${changes}" ]; then
case '${{ matrix.startarg.tag }}' in
i386) arch=i386;;
latest) arch=amd64;;
esac
containers/unit-tests/build $arch
fi

- name: Run unit-tests container
- name: Run unit test
timeout-minutes: 30
# HACK: -gdwarf-4 is for clang: https://bugs.kde.org/show_bug.cgi?id=452758
run: |
containers/unit-tests/start \
--verbose \
--env=FORCE_COLOR=1 \
--env=CC='${{ matrix.startarg.cc }}' \
--env=CFLAGS='-O2 -gdwarf-4' \
--env=EXTRA_DISTCHECK_CONFIGURE_FLAGS='${{ matrix.startarg.distcheck_flags }}' \
--image-tag='${{ matrix.startarg.tag }}' \
--make '${{ matrix.startarg.make }}'
./autogen.sh
make -j$(nproc) '${{ matrix.target }}'
26 changes: 0 additions & 26 deletions containers/unit-tests/Dockerfile

This file was deleted.

76 changes: 0 additions & 76 deletions containers/unit-tests/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions containers/unit-tests/build

This file was deleted.

12 changes: 0 additions & 12 deletions containers/unit-tests/entrypoint

This file was deleted.

79 changes: 0 additions & 79 deletions containers/unit-tests/setup.sh

This file was deleted.

Loading
Loading