From b05754e1c0e1eb4246022516656fd0f0629942d0 Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Wed, 16 Aug 2023 10:14:01 +0100 Subject: [PATCH 01/13] Fixed accidental CI checkin, archive CI logs --- .github/workflows/kernel-lts.yaml | 11 +++++++++++ ci/Dockerfile | 3 +-- ci/build-dahdi.sh | 6 ++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index 9c6d0781..a03cbe53 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -52,3 +52,14 @@ jobs: - name: Build dahdi-linux run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder" + - name: Archive kernel version + uses: actions/upload-artifact@v3 + with: + name: Kernel Version + path: ./dahdi-linux/build_logs/kernel_version.txt + + - name: Archive build log + uses: actions/upload-artifact@v3 + with: + name: Build Log + path: ./dahdi-linux/build_logs/build_log.txt diff --git a/ci/Dockerfile b/ci/Dockerfile index 76059bb2..204277a3 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -3,5 +3,4 @@ RUN apt-get update RUN apt-get -y upgrade RUN apt-get -y install gcc make perl-modules RUN apt-get -y install flex bison wget libssl-dev libelf-dev bc -ENTRYPOINT [ "/usr/bin/bash" ] - +ENTRYPOINT [ "/src/ci/build-dahdi.sh" ] diff --git a/ci/build-dahdi.sh b/ci/build-dahdi.sh index 0b328c6a..5ac0c6a5 100755 --- a/ci/build-dahdi.sh +++ b/ci/build-dahdi.sh @@ -1,4 +1,6 @@ #!/bin/sh +rm -rf /src/build_logs +mkdir -p /src/build_logs cd /linux echo "### Cleaning Kernel tree" echo " # rm .config" @@ -7,7 +9,7 @@ rm .config echo " # make clean" make clean echo "### Get kernel version" -make kernelversion +make kernelversion > /src/build_logs/kernel_version.txt echo "### Create defconfig and prepare for module building" echo " # make x86_64_defconfig" make x86_64_defconfig @@ -19,5 +21,5 @@ cd /src echo " # make clean" make clean echo " # make install KSRC=/linux" -make install KSRC=/linux +make install KSRC=/linux 2>&1 | tee /src/build_logs/build_log.txt From d007e3276641a15418027f928da8b5496be3c36a Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Wed, 16 Aug 2023 10:50:07 +0100 Subject: [PATCH 02/13] Rename artifacts for matrix builds --- .github/workflows/kernel-lts.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index a03cbe53..6f390b40 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -55,11 +55,11 @@ jobs: - name: Archive kernel version uses: actions/upload-artifact@v3 with: - name: Kernel Version + name: ${{matrix.kernel_branch}} Kernel Version path: ./dahdi-linux/build_logs/kernel_version.txt - name: Archive build log uses: actions/upload-artifact@v3 with: - name: Build Log + name: ${{matrix.kernel_branch}} Build Log path: ./dahdi-linux/build_logs/build_log.txt From 299a395529b5fc0bb8b6d6338907345eb15dd2ab Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:52:11 +0100 Subject: [PATCH 03/13] Reuse kernel check script --- .github/workflows/kernel-check.yaml | 64 +++++++++++++++++++++++++++++ .github/workflows/kernel-lts.yaml | 46 +++------------------ 2 files changed, 69 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/kernel-check.yaml diff --git a/.github/workflows/kernel-check.yaml b/.github/workflows/kernel-check.yaml new file mode 100644 index 00000000..12279b2e --- /dev/null +++ b/.github/workflows/kernel-check.yaml @@ -0,0 +1,64 @@ +name: Check Dahdi compilation against a kernel + +on: + workflow-call: + inputs: + kernel-git-cache: + description: 'The name of the cache for the kernel git repo' + required: true + type: string + kernel-git-repo: + description: 'The URL for the kernel git repo' + required: true + type: string + kernel-git-branch: + description: 'The branch to use' + type: string + +jobs: + kernel_test: + runs-on: ubuntu-latest + + steps: + - name: Cache kernel git repo + id: cache-kernel-git + uses: actions/cache@v3 + with: + path: ./linux + key: ${{ inputs.kernel-git-cache }} + + - if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }} + name: Clone Kernel repo + run: git clone ${{ inputs.kernel-git-repo }} + + - name: Update kernel git + run: git fetch + working-directory: ./linux + + - name: Switch to desired branch + run: git checkout ${{ inputs.kernel-git-branch }} + working-directory: ./linux + + - name: Fetch dahdi-linux + uses: actions/checkout@v3 + with: + path: dahdi-linux + + - name: Create build container + run: docker build ./ci -t dahdi-builder + working-directory: ./dahdi-linux + + - name: Build dahdi-linux + run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder" + + - name: Archive kernel version + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.kernel-git-branch }} Kernel Version + path: ./dahdi-linux/build_logs/kernel_version.txt + + - name: Archive build log + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.kernel-git-branch }} Build Log + path: ./dahdi-linux/build_logs/build_log.txt diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index 6f390b40..5c853349 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -21,45 +21,9 @@ jobs: 'linux-6.1.y' ] steps: - - name: Cache kernel git repo - id: cache-kernel-git - uses: actions/cache@v3 + call-kernel-check: + uses: asterisk/dahd-linux/.github/workflows/kernel-check.yaml@v1 with: - path: ./linux - key: kernel-git-cache - - - if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }} - name: Clone Kernel repo - run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git - - - name: Update kernel git - run: git fetch - working-directory: ./linux - - - name: Switch to desired branch - run: git checkout ${{matrix.kernel_branch}} - working-directory: ./linux - - - name: Fetch dahdi-linux - uses: actions/checkout@v3 - with: - path: dahdi-linux - - - name: Create build container - run: docker build ./ci -t dahdi-builder - working-directory: ./dahdi-linux - - - name: Build dahdi-linux - run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder" - - - name: Archive kernel version - uses: actions/upload-artifact@v3 - with: - name: ${{matrix.kernel_branch}} Kernel Version - path: ./dahdi-linux/build_logs/kernel_version.txt - - - name: Archive build log - uses: actions/upload-artifact@v3 - with: - name: ${{matrix.kernel_branch}} Build Log - path: ./dahdi-linux/build_logs/build_log.txt + kernel-git-cache: kernel-git-cache + kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + kernel-git-branch: ${{ matrix.kernel_branch }} From 9ee616e8d178a0ef9df538a52c021fb1ece25fd4 Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:31:05 +0100 Subject: [PATCH 04/13] Reuse kernel check script --- .github/workflows/kernel-lts.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index 5c853349..682d254d 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,10 +20,9 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - steps: - call-kernel-check: - uses: asterisk/dahd-linux/.github/workflows/kernel-check.yaml@v1 - with: - kernel-git-cache: kernel-git-cache - kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git - kernel-git-branch: ${{ matrix.kernel_branch }} + call-kernel-check: + uses: asterisk/dahd-linux/.github/workflows/kernel-check.yaml@v1 + with: + kernel-git-cache: kernel-git-cache + kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + kernel-git-branch: ${{ matrix.kernel_branch }} From 6c5189d81beb3ca956087ee9f7b598551744d50e Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:44:27 +0100 Subject: [PATCH 05/13] Reuse kernel check script --- .github/workflows/kernel-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-check.yaml b/.github/workflows/kernel-check.yaml index 12279b2e..36224ca3 100644 --- a/.github/workflows/kernel-check.yaml +++ b/.github/workflows/kernel-check.yaml @@ -1,7 +1,7 @@ name: Check Dahdi compilation against a kernel on: - workflow-call: + workflow_call: inputs: kernel-git-cache: description: 'The name of the cache for the kernel git repo' From 9a75fab6077f4d345e78caaa89691acd3e2e1de0 Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:57:08 +0100 Subject: [PATCH 06/13] Reuse kernel check script --- .github/workflows/kernel-lts.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index 682d254d..c78ff208 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,8 +20,7 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - call-kernel-check: - uses: asterisk/dahd-linux/.github/workflows/kernel-check.yaml@v1 + uses: asterisk/dahd-linux/.github/workflows/kernel-check.yaml@v1 with: kernel-git-cache: kernel-git-cache kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git From 72b7c7dad09e9424b19e1cea82058f4f8d56a947 Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:14:49 +0100 Subject: [PATCH 07/13] Fixed typo --- .github/workflows/kernel-lts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index c78ff208..88298310 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,7 +20,7 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - uses: asterisk/dahd-linux/.github/workflows/kernel-check.yaml@v1 + uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@v1 with: kernel-git-cache: kernel-git-cache kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git From 8452a7e215e411bd68e2c2b9d514d04271d40228 Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:29:39 +0100 Subject: [PATCH 08/13] Fixed typo --- .github/workflows/kernel-lts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index 88298310..b87843e9 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,7 +20,7 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@v1 + uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@master with: kernel-git-cache: kernel-git-cache kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git From ec1d9afb3c1da76ffa5b5a1870df986da7288fbe Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:38:59 +0100 Subject: [PATCH 09/13] Another go at YAML syntax.. --- .github/workflows/kernel-lts.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index b87843e9..45d9c627 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,8 +20,10 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@master - with: - kernel-git-cache: kernel-git-cache - kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git - kernel-git-branch: ${{ matrix.kernel_branch }} + steps: + - name: Run Build Test + uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@master + with: + kernel-git-cache: kernel-git-cache + kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + kernel-git-branch: ${{ matrix.kernel_branch }} From e22ebb3853970d4d6f79ddb901b6cbf69138554c Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:41:17 +0100 Subject: [PATCH 10/13] Another go at YAML syntax.. --- .github/workflows/kernel-lts.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index 45d9c627..b1a5a8b2 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,10 +20,8 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - steps: - - name: Run Build Test - uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@master - with: - kernel-git-cache: kernel-git-cache - kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git - kernel-git-branch: ${{ matrix.kernel_branch }} + uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@master + with: + kernel-git-cache: kernel-git-cache + kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + kernel-git-branch: ${{ matrix.kernel_branch }} From 4b8d5aa04f0068a607a495610f9321d77a54d7d5 Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:45:27 +0100 Subject: [PATCH 11/13] Another go at YAML syntax.. --- .github/workflows/kernel-lts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index b1a5a8b2..fdc6b877 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,7 +20,7 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@master + uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml with: kernel-git-cache: kernel-git-cache kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git From 618d2b3f59be6ef389123752f872ad0efc29caeb Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Thu, 17 Aug 2023 09:46:53 +0100 Subject: [PATCH 12/13] Try out versioning of re-usbale workflow --- .github/workflows/kernel-lts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index fdc6b877..8fa42bc5 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,7 +20,7 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml + uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@ci-fix with: kernel-git-cache: kernel-git-cache kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git From 2ac11cea4d6a9301a111fc3c82fff9b678e34cda Mon Sep 17 00:00:00 2001 From: Duncan Patterson <42005699+duncanpatterson@users.noreply.github.com> Date: Thu, 17 Aug 2023 10:02:21 +0100 Subject: [PATCH 13/13] Try out versioning of re-usbale workflow --- .github/workflows/kernel-lts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-lts.yaml b/.github/workflows/kernel-lts.yaml index 8fa42bc5..78f6064e 100644 --- a/.github/workflows/kernel-lts.yaml +++ b/.github/workflows/kernel-lts.yaml @@ -20,7 +20,7 @@ jobs: 'linux-5.15.y', 'linux-6.1.y' ] - uses: asterisk/dahdi-linux/.github/workflows/kernel-check.yaml@ci-fix + uses: duncanpatterson/dahdi-linux/.github/workflows/kernel-check.yaml@ci-fix with: kernel-git-cache: kernel-git-cache kernel-git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git