1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-12 19:09:56 +03:00
Commit graph

65 commits

Author SHA1 Message Date
Oliver Smith
459d5a6ac4
CI: fix running deploy job on master
* Run the docs job on master too if relevant files changed.
* Run the deploy job only with the same condition.

Fixes: 4dd82075 ("CI: Only run most pipelines when they actually are necessary")

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2639
2025-07-06 20:27:31 +02:00
Newbyte
4dd820756f
CI: Only run most pipelines when they actually are necessary
Plus, add pmbootstrap.py as a condition for integration tests.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2617
2025-07-05 15:14:44 +02:00
Oliver Smith
cdb51686c3
CI: fix coverage regex
Use exactly the same regex as in BPO where this works.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2609
2025-05-25 11:55:27 +02:00
Pablo Correa Gómez
7ca76314cd
ci: add test coverage to the GitLab UI
This is a small nit, but allows to see the coverage percentage change
across MRs. It gives a small dopamine boost to see an MR you sent has
tests and made a small impact in the overall coverage :)

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2596
2025-05-25 11:48:33 +02:00
Clayton Craft
226eeed6ff
ci: only run integration tests when there are code changes
This prevents running the integration tests, which cause load on the CI
and take time, when the change is unrelated to pmb functionality (e.g.
documentation updates).

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2608
2025-05-25 11:28:51 +02:00
Clayton Craft
740a5717d9
ci: only run markdown lint if markdown files are changed
This prevents running md linting in MRs where unrelated files are
changing, since the markdownlint tool could be upgraded to add new tests
that start failing and make these unrelated MRs unmergeable.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2606
2025-05-23 09:35:43 -07:00
Oliver Smith
3dd7b5e1f3
CI: test build for x86 pkg on x86_64 machine
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2577
2025-03-20 22:36:17 +01:00
Oliver Smith
0eaedba632
CI: test different cross compilation methods
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Caleb Connolly
14d9134d8b
CI: add markdown lint (MR 2485)
Add a CI job to enforce markdown linting

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2025-02-17 00:19:59 +01:00
Oliver Smith
21ab1b3c20
CI: use new runner where necessary (MR 2548)
Use the new runner we set up to work around the CI errors we have been
experiencing.
2025-02-05 23:59:00 +01:00
Oliver Smith
559710c69a
CI: docs: fail on warning (MR 2506) 2024-12-03 10:08:43 +01:00
Caleb Connolly
bb12609753
test: conftest: require_programs() automatically (MR 2483)
Pmbootstrap finds all its host dependencies during init, ensure we do
that for pytest too.

Adapt require_programs() to use subprocess directly rather than have to
solve the weird dependency chain of pmb.helpers.run which depends on the
global context being initialised before it's usable.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-11-29 16:50:04 +01:00
Caleb Connolly
f090e86126
test: parse: add tests for bootimg parsing (MR 2477) (MR 2483)
Add some unit tests to ensure that the parser correctly detects boot
images with header v0, 2, and 3.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-11-29 16:50:04 +01:00
Caleb Connolly
1131db214a
Revert "CI: Add bootimg analysis integration test (MR 2467)" (MR 2483)
This test includes a binary blob which we want to avoid in our codebase.

It is also better suited as a unit test where it can contribute to code
coverage. Revert this and use a unit test version instead.

This reverts commit d19de946b3.
2024-11-29 16:49:54 +01:00
Oliver Smith
1b4c38a01d
Revert "test: parse: add tests for bootimg parsing (MR 2477)" (MR 2482)
This caused a regression in CI tests.
This reverts commit ae35603197.

Related: issue 2497
2024-11-10 17:23:00 +01:00
Caleb Connolly
ae35603197
test: parse: add tests for bootimg parsing (MR 2477)
Add some unit tests to ensure that the parser correctly detects boot
images with header v0, 2, and 3.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-11-08 01:57:26 +01:00
Newbyte
d19de946b3
CI: Add bootimg analysis integration test (MR 2467) 2024-11-07 00:43:09 +01:00
Caleb Connolly
515fd99552
CI: combine lint and test stages (MR 2478)
While there are places where it would make some sense to catch issues in
the lint stage, most of the lint failures are things like shellchcek or
ruff which don't actually effect the functionality of the code.

Let's just run pytest at the same time as these to speed up the overall
pipeline.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-11-04 10:47:15 +01:00
Caleb Connolly
e268ec24d5
pytest: generate coverage and junit reports (MR 2478)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-11-04 10:46:11 +01:00
Oliver Smith
3b4b9cd061
gitlab-ci: install py3-tomli for py 3.10 tests (MR 2471)
pmbootstrap requires "tomli" if running with python < 3.11, so install
it.
2024-11-03 13:52:21 +01:00
Caleb Connolly
3592f9a285
CI: run pytest and install test against Python 3.10 (MR 2471)
Use Alpine 3.17 to test pmbootstrap with older versions of Python

Fixes: #2477
Suggested-by: Oliver Smith <ollieparanoid@postmarketos.org>
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-11-03 13:52:16 +01:00
Caleb Connolly
a1ff3a69f3
CI: expand integration tests (MR 2453)
Refactor the integration test script to support running a variety of
tests, and add CI jobs for them.

Additionally, move the integration tests to their own stage so we don't
potentially waste a bunch of CI time running them on broken branches.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-10-30 23:14:01 +01:00
Caleb Connolly
3dfe906871
CI: drop log.txt from integration job artifacts (MR 2453)
We run pmbootstrap with --details-to-stdout now, so this isn't needed.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-10-30 23:14:01 +01:00
Oliver Smith
497188eb30
CI: force IPv4 for gitlab.postmarketos.org (MR 2459) 2024-10-27 19:35:59 +01:00
Newbyte
e8e146c68a
CI: Add multipath-tools dependency (MR 2450)
Provides kpartx.
2024-10-27 13:14:11 +01:00
Clayton Craft
4f3ede3329
ci: add basic integration testing for pmb (MR 2444) 2024-10-21 23:48:20 +02:00
Luca Weiss
3df0be358f
Replace gitlab.com with gitlab.postmarketos.org (MR 2443)
Try to finish the migration by changing various links and texts to point
to the new GitLab instance.
2024-10-21 18:12:21 +02:00
Luca Weiss
4019636f72
ci: Run docs job in chroot (MR 2413)
Use the new "Artifacts" directive for .ci/docs.sh and run the job in the
pmbootstrap chroot to avoid needing to install sphinx dependencies on
the host.

Fixes #2352
2024-10-17 19:01:30 +02:00
Oliver Smith
2cf80bb534
gitlab-ci: remove 'allow_failure: true' (MR 2327)
Now that it is all passing, let's keep it that way!
2024-06-23 19:13:57 +02:00
Caleb Connolly
a8681006a3
CI: allow lint failures and fix pytest (MR 2252)
Adjust the pytest CI to work with the new tests.

It's useful to run pytest even when linters fail, so set allow_failure
for the lint jobs.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:41 +02:00
Clayton Craft
a8c24ae867
.gitlab-ci: save pmb log.txt on pytest failure (MR 2306)
Currently there is very little info from test failures when the test
fails in some call to pmbootstrap. By saving the log file to CI
artifacts on failure, we can make it really easy to find/obtain
important stuff to help with debugging.
2024-06-14 10:11:41 -07:00
Luca Weiss
048f24cf50
CI: Add docs deployment job (MR 2316)
Tweaked-By: Oliver Smith <ollieparanoid@postmarketos.org>
2024-06-06 18:09:56 +02:00
Luca Weiss
e9faee3747
CI: correct yaml indentation (MR 2316)
Seems GitLab CI doesn't really care but still fix it.
2024-06-06 18:06:48 +02:00
Newbyte
c1ffe85749
CI: Use latest (stable) Alpine instead of Edge (MR 2317)
Alpine 3.20 has released now which should contain everything we need to
run our CI.

Closes https://gitlab.com/postmarketOS/pmaports/-/issues/2747
2024-05-29 01:24:00 +02:00
Robert Eckelmann
d28174bf95
ci: add job to generate docs (MR 2266) 2024-05-14 14:36:24 +02:00
Newbyte
56dfdd4ad3
CI: Always update packages (MR 2297)
In case the Docker image is outdated, this means we get the latest
bug fixes and such anyway.
2024-04-16 18:39:48 +00:00
Newbyte
63759a11f5
CI: Stop adding testing repository in before_script (MR 2297)
Both Ruff and Codespell have been moved to the community
repository in Alpine:

 - https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/62711
 - https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/64338
2024-04-16 18:39:48 +00:00
Newbyte
b7dd9bec69
CI: Use yaml anchor for global before_script (MR 2297)
The local before_script variable overrides the global one, which I
assume wasn't the intent when the local before_script was added to
mr-settings. As such, add an achor to ensure that the global one is run
too.
2024-04-16 18:39:43 +00:00
Oliver Smith
2d90b558c1
CI: mypy: make compatible with "pmbootstrap ci" (MR 2258) 2024-02-16 10:04:25 +01:00
Newbyte
c18bff1c67
CI: add Mypy check (MR 2258) 2024-02-16 10:04:25 +01:00
Oliver Smith
f8d203e8e5
CI: bring back mr-settings check (MR 2234)
Add the check again that ensures we can write to the target repository.
This is needed for our merge style, we add the MR-ID to the title of the
commit message, and may do small fixups while merging.
2024-01-21 22:17:59 +00:00
Oliver Smith
13f277a56c
CI: use gitlab-ci 2024-01-16 22:26:58 +00:00
Oliver Smith
4b8a0db5bc
CI: replace gitlab CI with sourcehut CI
Replace .gitlab-ci.yml with a minimal .build.yml that runs a script in
the .ci dir for each task. Each of these scripts runs as root first,
installs dependencies, and then drops rights to the testuser and runs
the actual test. I went with this design, so we can add a
'pmbootstrap ci' command in following patches that run these in a
pmbootstrap chroot (see pmaports#2169).

Looking at flake8, we currently ignore W504 and W604. Would be nice to
fix these instead, but let's do that in another patch.

I've added a minver package to Alpine, so we don't need to install it
form pip anymore. Use minver's new --lint argument to simplify the
script, and as recommended by minver itself, use --no-parse-comments as
speed optimization since we don't have minver specific comments.

Using doas instead of sudo in build.yml would be nice, but this doesn't
work out of the box. Can be changed in the future.

Add a note to the pytest script, that 'pmbootstrap log' can be used to
follow the log while tests are running.
2022-10-25 20:31:19 +02:00
Oliver Smith
672ebe797b
Revert "CI: download shellcheck (MR 2142)"
It's back in Alpine edge.

This reverts commit 3987d2f764.
2021-11-27 15:32:15 +01:00
Oliver Smith
3987d2f764
CI: download shellcheck (MR 2142)
Similar fix as in pmaports MR 2673.
2021-11-11 22:50:28 +01:00
Oliver Smith
8a371cd18f
CI: remove stages (MR 2080)
It's more annoying than useful to have to wait for the first stage
before the second stage (pytest) starts. I'd rather have the whole
pipeline run through quicker and see if there are python errors too even
if linting errors are not resolved yet.

In pmaports.git this makes more sense: there we have "lint" and "build"
and in the worst case "build" may take up to three hours. So it makes
sense to only start it if there are no cosmetic errors. But that's not
the case here.
2021-07-04 22:51:54 +02:00
Oliver Smith
6c2b72ca13
CI: .gitlab/vermin.sh -> .ci/vermin.sh (MR 2080) 2021-07-04 22:51:53 +02:00
Oliver Smith
d7e22e4993
CI: check_mr_settings: use version from ci-common (MR 2080) 2021-07-04 22:51:53 +02:00
Oliver Smith
d38bd6be2b
CI: drop support for cached venv + ci runner (MR 2080)
CI started failing with:
/builds/ollieparanoid/pmbootstrap/venv/bin/python3: No module named pytest

I've briefly tried to fix this with the existing scripts. However,
instead of investing more time into that, do the long overdue
refactoring of the scripts that involve dropping the venv logic and
support for a custon gitlab-ci-runner using some python docker image as
base. This configuration hasn't been used for a long time and is
probably broken anyway.

Refactor the logic to skip the qemu test case in gitlab CI by using
pytest markers. The new script is now similar to bpo's .ci/pytest.py.
2021-07-04 22:51:53 +02:00
Maxim Karasev
479b51cfb6
CI: use Alpine for testing (MR 2074) 2021-06-28 02:07:55 +03:00