This Replicates the functionality of our Jenkins test-pr job (#2031)

move Jenkins pr testing to GitHub actions.

uses same logic for detecting changes in PR.

requires runner with public label
This commit is contained in:
lanefu
2020-06-17 15:20:08 -04:00
committed by GitHub
parent bfacc6cd89
commit 1ff911b57a

46
.github/workflows/testpr.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: build pr kernel
# This workflow is triggered on pushes to the repository.
on: [pull_request]
jobs:
build:
name: Compile changed kernel
# This job runs on self hosted Linux machine, with public label
runs-on: [self-hosted, public]
steps:
# - uses: rokroskar/workflow-run-cleanup-action@v0.2.2
# env:
# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v2
with:
fetch-depth: 0
path: build
clean: false
- uses: actions/checkout@v2
with:
repository: armbian/ci-testing-tools
path: ci-testing-tools
- name: Find SBC target and build kernel
shell: bash {0}
run: |
cd build
GIT_COMMIT=$(echo $GITHUB_SHA)
GIT_PREVIOUS_COMMIT=$(git rev-parse origin/$GITHUB_BASE_REF)
ARMBIAN_BOARD=tritium-h5
ARMBIAN_BRANCH=current
cd ..
env
source ci-testing-tools/jenkins_ci.sh
mkdir -p build/userpatches
cp -f ci-testing-tools/config-jenkins-kernel.conf build/userpatches/
configure_monorepo_watcher
generate_board_table
load_board_table
cd build
get_files_changed
get_build_target
git checkout ${GITHUB_SHA}
git branch -v
export GPG_TTY=$(tty)
build_kernel jenkins-kernel