CI: build master-ci in Actions (#24533)

* jenkins: build master-ci on pc

* make target configurable

* build on actions

* no wait

* more fetch

* v3 has push?

* example

* remove that

* wait

* v1.1.1

* this one works

* schedule

* clear out target first

* no lfs
pull/24537/head
Adeeb Shihadeh 3 years ago committed by GitHub
parent 8572c6aee6
commit 531f4483b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      .github/workflows/release.yaml
  2. 15
      Jenkinsfile
  3. 44
      release/build_devel.sh
  4. 1
      release/build_release.sh
  5. 5
      release/files_common
  6. 6
      release/files_pc
  7. 9
      release/files_tici
  8. 1
      release/identity.sh

@ -0,0 +1,27 @@
name: release
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
jobs:
build_masterci:
name: build master-ci
runs-on: ubuntu-20.04
timeout-minutes: 60
if: github.repository == 'commaai/openpilot'
steps:
- name: Wait for green check mark
uses: lewagon/wait-on-check-action@v0.2
with:
ref: master
wait-interval: 30
running-workflow-name: 'build master-ci'
- uses: actions/checkout@v3
with:
lfs: true
submodules: true
fetch-depth: 0
- name: Build master-ci
run: |
BRANCH=test-master-ci release/build_devel.sh

15
Jenkinsfile vendored

@ -107,7 +107,7 @@ pipeline {
} }
steps { steps {
phone_steps("tici", [ phone_steps("tici", [
["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"], ["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR EXTRA_FILES='tools/' ./build_devel.sh"],
["build openpilot", "cd selfdrive/manager && ./build.py"], ["build openpilot", "cd selfdrive/manager && ./build.py"],
["test manager", "python selfdrive/manager/test/test_manager.py"], ["test manager", "python selfdrive/manager/test/test_manager.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"], ["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
@ -150,18 +150,6 @@ pipeline {
} }
} }
stage('Push master-ci') {
when {
branch 'master'
}
steps {
phone_steps("tici-build", [
["push devel", "cd $SOURCE_DIR/release && PUSH='master-ci' ./build_devel.sh"],
])
}
}
} }
post { post {
@ -176,4 +164,3 @@ pipeline {
} }
} }
} }

@ -1,25 +1,30 @@
#!/usr/bin/bash -e #!/usr/bin/bash
set -ex
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
TARGET_DIR=/data/openpilot SOURCE_DIR="$(git -C $DIR rev-parse --show-toplevel)"
SOURCE_DIR="$(git rev-parse --show-toplevel)" if [ -z "$TARGET_DIR" ]; then
TARGET_DIR="$(mktemp -d)"
fi
# set git identity # set git identity
source $DIR/identity.sh source $DIR/identity.sh
echo "[-] Setting up repo T=$SECONDS" echo "[-] Setting up repo T=$SECONDS"
if [ ! -d "$TARGET_DIR" ]; then
mkdir -p $TARGET_DIR cd $SOURCE_DIR
cd $TARGET_DIR git fetch origin
git init
git remote add origin git@github.com:commaai/openpilot.git rm -rf $TARGET_DIR
fi mkdir -p $TARGET_DIR
cd $TARGET_DIR
cp -r $SOURCE_DIR/.git $TARGET_DIR
pre-commit uninstall || true
echo "[-] bringing master-ci and devel in sync T=$SECONDS" echo "[-] bringing master-ci and devel in sync T=$SECONDS"
cd $TARGET_DIR cd $TARGET_DIR
git prune || true
git remote prune origin || true
git fetch origin master-ci git fetch origin master-ci
git fetch origin devel git fetch origin devel
@ -28,6 +33,7 @@ git reset --hard master-ci
git checkout master-ci git checkout master-ci
git reset --hard origin/devel git reset --hard origin/devel
git clean -xdf git clean -xdf
git lfs uninstall
# remove everything except .git # remove everything except .git
echo "[-] erasing old openpilot T=$SECONDS" echo "[-] erasing old openpilot T=$SECONDS"
@ -40,8 +46,7 @@ git clean -xdf
# do the files copy # do the files copy
echo "[-] copying files T=$SECONDS" echo "[-] copying files T=$SECONDS"
cd $SOURCE_DIR cd $SOURCE_DIR
cp -pR --parents $(cat release/files_common) $TARGET_DIR/ cp -pR --parents $(cat release/files_*) $TARGET_DIR/
cp -pR --parents $(cat release/files_tici) $TARGET_DIR/
if [ ! -z "$EXTRA_FILES" ]; then if [ ! -z "$EXTRA_FILES" ]; then
cp -pR --parents $EXTRA_FILES $TARGET_DIR/ cp -pR --parents $EXTRA_FILES $TARGET_DIR/
fi fi
@ -49,8 +54,8 @@ fi
# append source commit hash and build date to version # append source commit hash and build date to version
GIT_HASH=$(git --git-dir=$SOURCE_DIR/.git rev-parse --short HEAD) GIT_HASH=$(git --git-dir=$SOURCE_DIR/.git rev-parse --short HEAD)
DATETIME=$(date '+%Y-%m-%dT%H:%M:%S') DATETIME=$(date '+%Y-%m-%dT%H:%M:%S')
VERSION=$(cat selfdrive/common/version.h | awk -F\" '{print $2}') VERSION=$(cat $SOURCE_DIR/selfdrive/common/version.h | awk -F\" '{print $2}')
echo "#define COMMA_VERSION \"$VERSION-$GIT_HASH-$DATETIME\"" > selfdrive/common/version.h #echo "#define COMMA_VERSION \"$VERSION-$GIT_HASH-$DATETIME\"" > $TARGET_DIR/selfdrive/common/version.h
# in the directory # in the directory
cd $TARGET_DIR cd $TARGET_DIR
@ -61,10 +66,9 @@ git add -f .
git status git status
git commit -a -m "openpilot v$VERSION release" git commit -a -m "openpilot v$VERSION release"
if [ ! -z "$PUSH" ]; then if [ ! -z "$BRANCH" ]; then
echo "[-] Pushing to $PUSH T=$SECONDS" echo "[-] Pushing to $BRANCH T=$SECONDS"
git remote set-url origin git@github.com:commaai/openpilot.git git push -f origin master-ci:$BRANCH
git push -f origin master-ci:$PUSH
fi fi
echo "[-] done T=$SECONDS" echo "[-] done T=$SECONDS, ready at $TARGET_DIR"

@ -19,6 +19,7 @@ fi
# set git identity # set git identity
source $DIR/identity.sh source $DIR/identity.sh
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
echo "[-] Setting up repo T=$SECONDS" echo "[-] Setting up repo T=$SECONDS"
rm -rf $BUILD_DIR rm -rf $BUILD_DIR

@ -195,8 +195,13 @@ selfdrive/hardware/base.h
selfdrive/hardware/base.py selfdrive/hardware/base.py
selfdrive/hardware/hw.h selfdrive/hardware/hw.h
selfdrive/hardware/tici/__init__.py selfdrive/hardware/tici/__init__.py
selfdrive/hardware/tici/hardware.h
selfdrive/hardware/tici/hardware.py selfdrive/hardware/tici/hardware.py
selfdrive/hardware/tici/pins.py
selfdrive/hardware/tici/agnos.py
selfdrive/hardware/tici/agnos.json
selfdrive/hardware/tici/amplifier.py selfdrive/hardware/tici/amplifier.py
selfdrive/hardware/tici/updater
selfdrive/hardware/tici/iwlist.py selfdrive/hardware/tici/iwlist.py
selfdrive/hardware/pc/__init__.py selfdrive/hardware/pc/__init__.py
selfdrive/hardware/pc/hardware.py selfdrive/hardware/pc/hardware.py

@ -1,5 +1,3 @@
selfdrive/ui/replay/* third_party/mapbox-gl-native-qt/x86_64/*.so
third_party/mapbox-gl-native-qt/x86_64/** third_party/qt-plugins/x86_64/geoservices/*.so
third_party/qt-plugins/x86_64/**

@ -11,15 +11,6 @@ selfdrive/camerad/cameras/camera_qcom2.cc
selfdrive/camerad/cameras/camera_qcom2.h selfdrive/camerad/cameras/camera_qcom2.h
selfdrive/camerad/cameras/real_debayer.cl selfdrive/camerad/cameras/real_debayer.cl
selfdrive/hardware/tici/__init__.py
selfdrive/hardware/tici/hardware.h
selfdrive/hardware/tici/hardware.py
selfdrive/hardware/tici/pins.py
selfdrive/hardware/tici/agnos.py
selfdrive/hardware/tici/agnos.json
selfdrive/hardware/tici/amplifier.py
selfdrive/hardware/tici/updater
selfdrive/ui/qt/spinner_larch64 selfdrive/ui/qt/spinner_larch64
selfdrive/ui/qt/text_larch64 selfdrive/ui/qt/text_larch64
selfdrive/ui/qt/maps/*.cc selfdrive/ui/qt/maps/*.cc

@ -2,4 +2,3 @@ export GIT_COMMITTER_NAME="Vehicle Researcher"
export GIT_COMMITTER_EMAIL="user@comma.ai" export GIT_COMMITTER_EMAIL="user@comma.ai"
export GIT_AUTHOR_NAME="Vehicle Researcher" export GIT_AUTHOR_NAME="Vehicle Researcher"
export GIT_AUTHOR_EMAIL="user@comma.ai" export GIT_AUTHOR_EMAIL="user@comma.ai"
export GIT_SSH_COMMAND="ssh -i /data/gitkey"

Loading…
Cancel
Save