Commit Graph

115 Commits

Author SHA1 Message Date
Christian Marangi
05331f0ef8
CI: kernel: test each subtarget on push events
Test each subtarget on push events to improve testing and to refresh
ccache of each subtarget.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 5bafc4352f)
2023-10-24 17:12:05 +02:00
Christian Marangi
f7e4f8cbbf
CI: add support for getting ccache cache from S3
Add support for getting ccache cache from S3.
ccache is archieved in a tar and downloaded from S3 Cloud Storage.

For push events, ccache is then uplodaed back to S3 to refresh and have
a ccache cache always fresh.

An additional workflow is added to upload files to an S3 Cloud Storage
from artifacts uplodaed to github. The minio tool is used to upload
files to S3.

If the ccache can't be downloaded from s3, we fallback to github cache
system.

Also limit s3 upload to the openwrt repository since external fork won't
have (obviously) the required secrtes to upload data to the S3 Cloud
Storage.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ebbc806d30)
2023-10-24 17:12:05 +02:00
Christian Marangi
5bfa66bcf3
CI: build: limit cache save/delete only on push events
Limit ccache cache save/delete only on push events. Saving ccache
cache for pull request will result in bloat and refreshing ccache is not
possible due to security measure on enforcing read permission on
pull_request events.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ff66a7c1c0)
2023-10-24 17:12:05 +02:00
Christian Marangi
15f4d6b244
CI: coverity: disable ccache usage
Disable ccache usage for coverity workflow as it may cause side effect
in the produced bins.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 2129ee1879)
2023-10-24 17:12:04 +02:00
Christian Marangi
51adcb7cd2
CI: build: fix ccache cache usage
CCache cache is currently broken due to a funny bug in ccache compiler
type detection. It seems ccache compiler type detection is very fragile
and with the use of external toolchain doesn't correctly detect the
type.
The type detected is set to other instead of gcc resulting in ccache
complaining for unsupported compiler options.

To handle this problem, force the compiler type to gcc to make ccache
correctly work and speedup compilation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ae7b05328c)
2023-10-24 17:12:04 +02:00
Christian Marangi
d7e2468e13
CI: build: add option to define custom ccache cache type
Add new input to define custom ccache cache type. This is useful to use
a different ccache cache for some special workflow that may do more test
than simple kernel compilation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 07b52a8a25)
2023-10-24 17:12:04 +02:00
Christian Marangi
c8d4694d2c
CI: build: add option to disable use of ccache
Add option to disable use of ccache. This can be useful for some
sensible test that should not use ccache as they can cause side effects
of any sort. (example Coverity Scan)

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit b9a41c1e84)
2023-10-24 17:12:04 +02:00
Christian Marangi
fad08e8e23
CI: build: add job to remove previous ccache cache if already exist
Github Actions cache doesn't permit to overwrite cache if it does
already exist. As a trick to refresh and have fresh ccache pool,
delete the ccache cache if it does exist with the help of Github REST
API. An additional permission is needed to access this API. Add this
permittion to each user of the build workflow.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 203cc0a7ef)
2023-10-24 17:12:03 +02:00
Christian Marangi
c5441d24d9
CI: build: split cache ccache in separate restore and save jobs
Split caching ccache in separate restore and save jobs to always refresh
the ccache across different runs. Currently if a key is restored, cache
is not saved resulting in a less useful ccache that benefits from
multiple runs.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 6321361c6b)
2023-10-24 17:12:03 +02:00
Christian Marangi
f666723f6d
CI: ignore master branch for push events
Due to problem with migrating from master to main as the default branch
and downstream project still requiring the master branch to be present,
we currently have for push events double CI runs, one for main and one
for master. To solve this ignore any push event to the master branch for
every workflow that react on push events.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit f5a5ce8822)
2023-10-24 17:11:31 +02:00
Christian Marangi
e83384b87e
CI: build: Add support to use container included external toolchain
Add support to use container included external toolchain and skip
redownloading external sdk for each test.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 0fe5776f4a)
2023-10-24 17:11:06 +02:00
Christian Marangi
e2780cbb2f
CI: push-containers: build and push container with external toolchain
Build and push container with external toolchain embedded in the
container image.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit e1370cdd49)
2023-10-24 17:11:06 +02:00
Christian Marangi
6099d083a6
CI: build: add checks to test if toolchain container can be used
Add checks to test if toolchain container can be used.
This is to handle case of new target or migration of any sort.

If the toolchain container can't be found, the tools container is used
instead.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 23a5c715a9)
2023-10-24 17:11:06 +02:00
Christian Marangi
6c80c7533b
CI: build: add option to configure container to use
Add option to configure container to use for build test.
By default the tools container is used if no option is provided.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 803b011048)
2023-10-24 17:11:06 +02:00
Christian Marangi
b98b3d4296
CI: build: package external toolchain after build
Package external toolchain after correct build.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ce2e7c52f8)
2023-10-24 17:10:47 +02:00
Christian Marangi
6420851c0c
CI: build: drop redundant generate ccache hash job
Drop redundant generare ccache hash job as that can be done by
integrated github expressions to generate an hash.
The only change is that the integrated way generate a sha256 hash
instead of an md5 sum.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 457f6b0b9c)
2023-10-24 17:06:56 +02:00
Christian Marangi
2a457dcd72
CI: push-containers: refresh containers also on modify cmake options
Refresh containers also on modify of cmake options in the include file.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit b40c0b54bd)
2023-10-04 13:30:52 +02:00
Christian Marangi
07e4352d80
CI: push-containers: fix concurrency group
Fix concurrency group for push-containers workflow to handle running on
different branches.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 4c2eab1c27)
2023-10-04 13:30:43 +02:00
Piotr Dymacz
55993f1fc1 CI: labeler: add sifiveu target
Add support for 'sifiveu' target and its specific packages in labeler.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 92b8b18c26)
2023-06-16 19:47:39 +02:00
Mathew McBride
8d557d4744
CI: change armvirt reference to armsr
The armvirt target has been renamed to armsr.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 3df01b1aa4)
2023-06-13 14:14:34 +02:00
Christian Marangi
3a1cb63336
CI: use toolchain container for label workflow
Use toolchain container for label workflow to skip downloading external
toolchain from openwrt servers.

Fixes: 0fe5776f4a ("CI: build: Add support to use container included external toolchain")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 66fd0aa6ef)
2023-05-28 03:47:01 +02:00
Christian Marangi
4174768d9f
CI: don't add "" in target and subtarget for label workflow
Don't add "" in target and subtarget for label workflow from label
detection as it does cause problem in build workflow on container
target/subtarget matching.

Fixes: bf8187d5dc ("CI: use split target and subtarget in label workflow")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 1fa84354a9)
2023-05-27 19:59:29 +02:00
Christian Marangi
ec6bbc5255
CI: build: fix parse toolchain step failing for git strict rules
Commit 1cb8cdb ("ci: use new buildbot worker images with Debian 11")
introduced new Git version with strict rules for owner of the git
directory.

To handle this and not cause major change, just move the parsing before
the change of ownership of the openwrt directory permitting the correct
run of git fetch command with the same user that did the repository
checkout.

Fixes: 1cb8cdb ("ci: use new buildbot worker images with Debian 11")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 0063e71d66)
2023-05-25 23:49:33 +02:00
Christian Marangi
962334bc82
CI: correctly output subtarget in label workflow
Commit bf8187d5dc ("CI: use split target and subtarget in label
workflow") didn't correctly output subtarget resulting in calling with
an empty subtarget. Fix this and correctly output generated subtarget.

Fixes: bf8187d5dc ("CI: use split target and subtarget in label workflow")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8aa5a86010)
2023-05-25 23:15:26 +02:00
Christian Marangi
7666503f68
CI: use split target and subtarget in label workflow
With eecc6e4811 ("CI: rework build workflow to have split target and
subtarget directly") target and subtarget are split in 2 different
variables. Label workflow were not aligned to this change and are
currently broken.

Fix them and correctly pass split target and subtarget.

Fixes: eecc6e4811 ("CI: rework build workflow to have split target and subtarget directly")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit bf8187d5dc)
2023-05-25 23:15:26 +02:00
Christian Marangi
b79ed14dd1 CI: rework build workflow to have split target and subtarget directly
Instead of referring to a redundant job and ENV variables, rework build
workflow to accept and require split target and subtarget and use them
directly from inputs.

Rework each user and pass a JSON of tuple to matrix include with each
target/subtarget combination to test. Special notice this doesn't use
the github actions matrix combination feature but reference each
specific tuple of target and subtarget to test.

Just a cleanup no behaviour change intended.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit eecc6e4811)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-05-24 19:26:06 +01:00
Christian Marangi
bf82648bf7 CI: check-kernel-patches: use buildbot user on git diff check
Use buildbot user on git diff check instead of using git config
safe directory.

This should accomplish the same result but should be a better approach
following safe practice enforced by git.

Fixes: a7747e8670 ("ci: fix check kernel patches job")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 6c80a578a4)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-05-24 19:26:02 +01:00
Petr Štetiar
7df43979d1
ci: push-containers: trigger job on release branching
Currently all 23.05 related CI jobs are failing as the containers are
not available, so lets fix it by pushing those containers when the
version.mk changes.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8fc2a0f00f)
2023-05-23 21:41:49 +02:00
Petr Štetiar
7d226e13e2
ci: tools: run the job on changes in include directory as well
In order to prevent regressions like with #12617.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 71ca2a3154)
2023-05-23 21:41:44 +02:00
Petr Štetiar
a7747e8670 ci: fix check kernel patches job
Currently the check fails due to the following error:

 warning: Not a git repository. Use --no-index to compare two paths outside a working tree
 usage: git diff --no-index [<options>] <path> <path>

Thats likely caused by commit 1cb8cdbf07 ("ci: use new buildbot worker
images with Debian 11") which contains a patched Git version with CVE
security fixes introduced in DLA-3239-2:

 Multiple issues were found in Git, a distributed revision control
 system. An attacker may cause other local users into executing arbitrary
 commands, leak information from the local filesystem, and bypass
 restricted shell.

 Note: Due to new security checks, access to repositories owned and
 accessed by different local users may now be rejected by Git; in case
 changing ownership is not practical, git displays a way to bypass these
 checks using the new "safe.directory" configuration entry.

So lets opt-out of this new behavior by setting `safe.directory=*` and
thus force Git to consider all Git repositories as safe regardless of
their owner, since we need to trust those sources anyway and it should
be likely more robust solution, then fiddling with filesystem
permissions.

Fixes: 1cb8cdbf07 ("ci: use new buildbot worker images with Debian 11")
References: https://www.debian.org/lts/security/2022/dla-3239-2
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-05-18 08:19:17 +02:00
Petr Štetiar
1cb8cdbf07 ci: use new buildbot worker images with Debian 11
Debian 10 LTS support ends on 6/2024, so it makes no sense to use it as
a base for 23.05 release, so lets switch to Debian 11 which should've
LTS support till 6/2026.

References: f2744543fa
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-05-15 20:43:47 +02:00
Petr Štetiar
9a26669510
ci: add Coverity Scan scheduled workflow
Coverity Scan is a static code analysis service focused on open source
software quality and security, so lets scan various OpenWrt components
every Friday for the start.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-04-26 17:24:50 +02:00
Christian Marangi
7643d95bb3
CI: check-kernel-patches: upload proposed refreshed patches
Upload proposed refreshed patches if the check fails.
This should help devs refresh the patches if they don't have access to a
buildroot.

Devs should ALWAYS refresh the patches before submitting and merging
commits.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-22 17:19:18 +02:00
Christian Marangi
a2973060ea
CI: build: disable cache of external toolchain/sdk
Our buildbot build a different external toolchain/sdk for each build.
This cause the idea of using the tar hash to cache it broken and wrong.
This makes the github cache bloated and remove space for ccache cache.

Drop cache for external toolchain/sdk as the feature is broken and cause
problems to ccache cache.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-03-22 01:07:57 +01:00
Christian Marangi
0c2b591b84
CI: kernel: skip subtarget test on non-specific target test
Reduce testing time by skipping subtarget test on non-specific target
test.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-03-22 00:36:33 +01:00
Christian Marangi
6f89a0ca20
CI: use openwrt official tools container by default
Use openwrt official tools container by default.
Fork will use openwrt tools container by default.

This can be disabled by setting the option use_openwrt_container to
false for the build.yml and check-kernel-patches.yml.

The push-containers workflow is disabled on forks. The workflow can be
reenabled by commenting the condition in push-containers.yml.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-31 16:36:57 +01:00
Petr Štetiar
ba3aa6233d ci: allow custom kernel and target jobs based on labels
Current job triggers based on matching of changed paths is quite
limited, so lets make it possible to additionally trigger manual CI jobs
by adding CI specific pull request build labels:

 * `ci:target:x86:64` label is going to trigger CI target check jobs for
    x86/64 (sub)target.

 * `ci:kernel:x86:64` label is going to trigger CI kernel check jobs for
    x86/64 (sub)target.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-01-27 11:04:07 +01:00
Christian Marangi
d5943ffed8
CI: push-containers: limit to one concurrent run
We may find in a situation where due the queue an old run finish after
the last run, resulting in the containers getting overwritten with an
old version.

Limit the push-containers workflow to one concurrent run and cancel any
run in progress.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-24 23:23:56 +01:00
Christian Marangi
d40f59825a
CI: tools: directly copy prebuilt tools in container
Directly copy prebuilt tools in container instead of creating an
archieve and extracting it later in other workflows.

Update build workflow to support this new implementation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-23 19:18:06 +01:00
Christian Marangi
7fe3d3670b
CI: tools: skip including dl dir in prebuilt tools tar
We can now drop the dl dir in the prebuilt tools tar as package archieve
is not a requirement anymore and won't trigger a package recompile.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-23 19:18:06 +01:00
Rosen Penev
183bad6641
CI: tools: add gnu-getopt to macOS CI
This used to be implicit. No longer for some reason.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-23 15:48:07 +01:00
Christian Marangi
6ca347379a
CI: kernel: enable target testing also for pull request event
Testing target changes was only set for push events. Enable this also
for pull request events to enable testing pr making specific target
changes.

Fixes: 57a02cbbff ("CI: kernel: test each target with additional changes than target/linux")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-20 15:14:53 +01:00
Robert Marko
d9b80ba8b8 CI: labeler: add ipq807x target
Add support for ipq807x target to the labeler.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00
Rosen Penev
0a35d3f992
CI: remove pcre from macOS
ff02e1561f added a host version of pcre
for packages that need it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-11 22:55:43 +01:00
Rosen Penev
dd357409f6
CI: remove already installed packages
The GitHub image already includes these.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-11 22:55:42 +01:00
Rosen Penev
11627f3ac1
CI: remove various tools from macOS
zstd, openssl, and quilt are already built in tools/. No need to install
them.

The rest are unused.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-11 22:55:42 +01:00
Christian Marangi
57a02cbbff
CI: kernel: test each target with additional changes than target/linux
Test each target if there are additional changes than target/linux.
This is needed to do wide test with changes to kmods, include/kernel and
changes to the workflow files.

While at it also cleanup and rework the code to drop duplication.
Also drop since_last_remote_commit to better track changes.

Fixes: 04ada8bc41 ("CI: kernel: build only changed targets")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-11 17:46:53 +01:00
Christian Marangi
cb679adf18
CI: add concurrency limits for pr test
Add concurrency limits for pull request test so that on pull request
refresh old jobs are cancelled.

The group is created based on the github ref + workflow name and the
workflow is cancelled only it it comes from a pull_request event.
Push events are not affected by this limit.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-11 14:31:57 +01:00
Christian Marangi
04ada8bc41
CI: kernel: build only changed targets
Detect changes in commit and build only changed targets.
If a change is related to the generic target, build test each target.

The matrix json is split. For target check patch only the first
subtarget is selected, for build test each target subtarget is built.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-11 14:28:41 +01:00
Christian Marangi
895f38ca1e
CI: build: fallback to compile toolchain if external toolchain fail
If for whatever reason external toolchain can't be found or downloaded,
fallback to internal toolchain build.

This can be useful when new target are introduced and external toolchain
are not present in openwrt fileserver.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-11 00:05:18 +01:00