* [PATCH 1/2] backports-update-manager: Add option to not update git trees
@ 2024-01-22 21:36 Hauke Mehrtens
2024-01-22 21:36 ` [PATCH 2/2] github: Add github action to test build Hauke Mehrtens
0 siblings, 1 reply; 2+ messages in thread
From: Hauke Mehrtens @ 2024-01-22 21:36 UTC (permalink / raw)
To: backports; +Cc: Hauke Mehrtens
Add the '--no-git-update which will deactivate updating the git trees.
This can be used in the github actions.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
devel/backports-update-manager | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/devel/backports-update-manager b/devel/backports-update-manager
index 9177be76..815a0421 100755
--- a/devel/backports-update-manager
+++ b/devel/backports-update-manager
@@ -629,6 +629,8 @@ def _main():
parser.add_argument('--reference', metavar='<path-to-git-obj-dir>', type=str,
default=None,
help='Override what argument to use to git clone --reference')
+ parser.add_argument('--no-git-update', const=True, default=False, action="store_const",
+ help='Don\'t update git trees')
args = parser.parse_args()
bk_updater = backport_kernel_updater(yes=args.yes or args.force,
@@ -649,7 +651,8 @@ def _main():
bk_updater.remove_stale_kernel_dirs()
bk_updater.get_backport_pkgs()
bk_updater.extract_backport_pkgs()
- bk_updater.update_git_trees()
+ if not args.no_git_update:
+ bk_updater.update_git_trees()
return 0
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] github: Add github action to test build
2024-01-22 21:36 [PATCH 1/2] backports-update-manager: Add option to not update git trees Hauke Mehrtens
@ 2024-01-22 21:36 ` Hauke Mehrtens
0 siblings, 0 replies; 2+ messages in thread
From: Hauke Mehrtens @ 2024-01-22 21:36 UTC (permalink / raw)
To: backports; +Cc: Hauke Mehrtens
Use github actions to build test changes in backports.
This creates a docker container with the test kernel files to
test compile against. This should get stored persistently.
In addition the patch adds a github action which creates a new
backports tar file and uses this new container to build test the newly
created backports tar.
This allows to build test a backports release using github actions.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
.github/workflows/build_publish_container.yml | 46 +++++++
.../build_publish_container/Dockerfile | 16 +++
.github/workflows/create.yml | 115 ++++++++++++++++++
3 files changed, 177 insertions(+)
create mode 100644 .github/workflows/build_publish_container.yml
create mode 100644 .github/workflows/build_publish_container/Dockerfile
create mode 100644 .github/workflows/create.yml
diff --git a/.github/workflows/build_publish_container.yml b/.github/workflows/build_publish_container.yml
new file mode 100644
index 00000000..d4fabbd5
--- /dev/null
+++ b/.github/workflows/build_publish_container.yml
@@ -0,0 +1,46 @@
+name: Build and publish container
+
+on:
+ workflow_dispatch:
+ push:
+ tags:
+ - 'v*'
+
+env:
+ REGISTRY: ghcr.io
+ IMAGE_NAME: ${{ github.repository }}
+
+jobs:
+ push_to_registry:
+ name: push to registry
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: read
+ packages: write
+
+ steps:
+ - name: Check out the repo
+ uses: actions/checkout@v4
+
+ - name: Log in to Docker Hub
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta
+ uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c
+ with:
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
+ with:
+ context: .
+ file: .github/workflows/build_publish_container/Dockerfile
+ push: true
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
diff --git a/.github/workflows/build_publish_container/Dockerfile b/.github/workflows/build_publish_container/Dockerfile
new file mode 100644
index 00000000..1dcdb06f
--- /dev/null
+++ b/.github/workflows/build_publish_container/Dockerfile
@@ -0,0 +1,16 @@
+FROM ubuntu:22.04
+
+RUN apt update && \
+ apt install -y git coccinelle build-essential python3 python3-pip python-is-python3 flex bison libelf1 && \
+ rm -rf /var/lib/apt/lists/*
+
+RUN pip install pyzstd
+
+RUN git clone https://github.com/hauke/backports.git --branch github-action
+
+RUN /backports/devel/backports-update-manager --yes --no-git-update && \
+ rm -rf /ksrc-backports/debs/
+
+RUN rm -rf /backports
+
+WORKDIR /
diff --git a/.github/workflows/create.yml b/.github/workflows/create.yml
new file mode 100644
index 00000000..6ed0a270
--- /dev/null
+++ b/.github/workflows/create.yml
@@ -0,0 +1,115 @@
+name: 'Create backports tar'
+
+on:
+ push:
+
+jobs:
+ create_tar:
+ name: Create backports tar
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Install coccinelle
+ run: |
+ sudo apt update
+ sudo apt install -y coccinelle
+
+ - name: Checkout backports
+ uses: actions/checkout@v4
+ with:
+ path: backports
+
+ - name: Checkout kernel
+ uses: actions/checkout@v4
+ with:
+ repository: gregkh/linux
+ ref: refs/heads/linux-5.15.y
+ path: linux
+
+ - name: Generate backports tar
+ working-directory: backports
+ run: ./gentree.py --refresh ${GITHUB_WORKSPACE}/linux ${GITHUB_WORKSPACE}/backports-generated
+
+ - name: Check for git changes
+ working-directory: backports
+ run: git diff
+
+ - name: Pack backports-generated.tar.gz
+ run: tar cfz backports-generated.tar.gz backports-generated
+
+ - name: Upload backports-generated.tar.gz
+ uses: actions/upload-artifact@v3
+ with:
+ name: backports-generated.tar.gz
+ path: backports-generated.tar.gz
+
+
+ check_build:
+ name: Test backports tar
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/hauke/backports
+
+ needs: create_tar
+ continue-on-error: true
+ strategy:
+ matrix:
+ kernel: [
+ "4.4",
+ "4.5",
+ "4.6",
+ "4.7",
+ "4.8",
+ "4.9",
+ "4.10",
+ "4.11",
+ "4.12",
+ "4.13",
+ "4.14",
+ "4.15",
+ "4.16",
+ "4.17",
+ "4.18",
+ "4.19",
+ "5.0",
+ "5.1",
+ "5.2",
+ "5.3",
+ "5.4",
+ "5.5",
+ "5.6",
+ "5.7",
+ "5.8",
+ "5.9",
+ "5.10",
+ "5.11",
+ "5.12",
+ "5.13",
+ "5.14",
+ "5.15"]
+ config: [
+ allyesconfig,
+ defconfig-wifi]
+
+ steps:
+ - name: Checkout backports
+ uses: actions/checkout@v4
+ with:
+ path: backports
+
+ - name: Download backports-generated.tar.gz
+ uses: actions/download-artifact@v3
+ with:
+ name: backports-generated.tar.gz
+
+ - name: Unpack backports-generated.tar.gz
+ run: tar xf backports-generated.tar.gz
+
+ - name: Create build configuration
+ working-directory: backports-generated
+ run: make -j$(nproc) KLIB=/ksrc-backports/lib/modules/${{ matrix.kernel }}.*/build/ KLIB_BUILD=/ksrc-backports/lib/modules/${{ matrix.kernel }}.*/build/ ${{ matrix.config }}
+
+ - name: Build
+ working-directory: backports-generated
+ run: make -j$(nproc) KLIB=/ksrc-backports/lib/modules/${{ matrix.kernel }}.*/build/ KLIB_BUILD=/ksrc-backports/lib/modules/${{ matrix.kernel }}.*/build/
+
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-22 21:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 21:36 [PATCH 1/2] backports-update-manager: Add option to not update git trees Hauke Mehrtens
2024-01-22 21:36 ` [PATCH 2/2] github: Add github action to test build Hauke Mehrtens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).