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 the correct container #20169

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cockpit-ci/container
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quay.io/cockpit/tasks:2024-03-13
29 changes: 15 additions & 14 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ jobs:
unit-tests:
runs-on: ubuntu-22.04
permissions: {}
container:
image: quay.io/cockpit/tasks:latest
options: --user 1001
strategy:
matrix:
target:
Expand All @@ -17,20 +14,24 @@ jobs:
- 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: Run unit test
timeout-minutes: 30
run: |
set -eux

IMAGE="$(curl --fail https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_SHA}/.cockpit-ci/container)"
podman run --network=host --rm --interactive "${IMAGE}" sh -eux <<EOF
export FORCE_COLOR=1
export TEST_BROWSER=firefox
export CFLAGS=-O2
Comment on lines +25 to +27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman run -e, but in the end it doesn't matter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered it, but I prefer the way this looked.


git clone https://github.com/${GITHUB_REPOSITORY} make-checkout-workdir
cd make-checkout-workdir
git fetch origin ${GITHUB_SHA}
git reset --hard ${GITHUB_SHA}

vendor/checkout
./autogen.sh
make -j$(nproc) '${{ matrix.target }}'
EOF
Loading