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

Fixed accidental CI checkin, archive CI logs #33

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
64 changes: 64 additions & 0 deletions .github/workflows/kernel-check.yaml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 5 additions & 32 deletions .github/workflows/kernel-lts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,8 @@ jobs:
'linux-5.15.y',
'linux-6.1.y'
]
steps:
- name: Cache kernel git repo
id: cache-kernel-git
uses: actions/cache@v3
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"

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
kernel-git-branch: ${{ matrix.kernel_branch }}
3 changes: 1 addition & 2 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
6 changes: 4 additions & 2 deletions ci/build-dahdi.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand All @@ -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