Skip to content

Commit

Permalink
Migrate to GitHub Actions from CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
leee committed Dec 11, 2023
1 parent 017b79e commit f5953a8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: CI

on: [push, pull_request]

jobs:
vanilla:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install -y make build-essential
- run: make vanilla
reproducibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install -y make build-essential reprotest
- run: make reprotest
- run: echo $PWD
# reproducibility-securedrop:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - run: sudo apt-get update && sudo apt-get install -y make build-essential reprotest
# - run: make reprotest-sd
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ SCRIPT_OUTPUT_EXT=log
.PHONY: vanilla
vanilla: OUT:=$(SCRIPT_OUTPUT_PREFIX)-vanilla.$(SCRIPT_OUTPUT_EXT)
vanilla: ## Builds latest stable kernel, unpatched
LINUX_MAJOR_VERSION="5.15" \
script \
--command ./scripts/build-kernel-wrapper \
--return \
$(OUT)
LINUX_MAJOR_VERSION="5.15" ./scripts/build-kernel-wrapper

.PHONY: grsec
grsec: OUT:=$(SCRIPT_OUTPUT_PREFIX)-grsec.$(SCRIPT_OUTPUT_EXT)
Expand Down
27 changes: 27 additions & 0 deletions scripts/build-kernel-wrapper
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash

echo "XKCD 1"

set -e
set -u
set -o pipefail

echo "XKCD 2"

# SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)"
# DEBUG: setting constant value to make eval easier
Expand All @@ -13,27 +16,48 @@ export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH}"
export DEB_BUILD_TIMESTAMP="${SOURCE_DATE_EPOCH}"
export TERM=dumb # to omit control characters from "script" transcripts

echo "XKCD 3"
echo $PWD
env

# Build container image for kernel dependencies
IMG_NAME="fpf.local/kernel-builder"
docker build -t "$IMG_NAME" \
--build-arg UID="$(id -u)" \
--build-arg GID="$(id -g)" \
.

echo "XKCD 4"
echo $PWD
env

# Configure local customizations
local_config_volume_opt=""
if [[ -n "${LINUX_LOCAL_CONFIG_PATH:-}" ]]; then
local_config_volume_opt="-v ${LINUX_LOCAL_CONFIG_PATH}:/config:ro"
fi

echo "XKCD 5"

local_patches_volume_opt=""
if [[ -n "${LINUX_LOCAL_PATCHES_PATH:-}" ]]; then
local_patches_volume_opt="-v ${LINUX_LOCAL_PATCHES_PATH}:/patches:ro"
fi

echo "XKCD 6"

echo $PWD
env

# Create output dir
kernel_dir="$PWD/build"
mkdir -p -m 755 "$kernel_dir"

echo "XKCD 7"

echo $PWD
env

# TODO: It'd be great to pass `-i` here so the builds can be cancelled,
# but that breaks reprotest. Pass it conditionally, depending on whether
# there's an interactive session available.
Expand All @@ -53,5 +77,8 @@ docker run --rm -t \
$local_patches_volume_opt \
"$IMG_NAME"

echo "XKCD 8"


echo "Build complete. Packages can be found at:"
find "$kernel_dir" -type f | sort

0 comments on commit f5953a8

Please sign in to comment.