check if commit is on master
This commit is contained in:
40
.circleci/check-commit.sh
Executable file
40
.circleci/check-commit.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# check to see that submodule commits are present on the master branch
|
||||
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# enter bhd repo
|
||||
cd $HOME/project
|
||||
|
||||
# initialize submodules and get the hashes
|
||||
git submodule update --init
|
||||
status=$(git submodule status)
|
||||
|
||||
search () {
|
||||
for submodule in "${submodules[@]}"
|
||||
do
|
||||
echo "Running check on submodule $submodule in $dir"
|
||||
hash=$(echo "$status" | grep $submodule | awk '{print$1}' | grep -o "[[:alnum:]]*")
|
||||
echo "Searching for $hash in origin/master of $submodule"
|
||||
git -C $dir/$submodule log origin/master | grep "$hash" # needs init'ed submodules
|
||||
done
|
||||
}
|
||||
|
||||
submodules=("boom" "hwacha" "rocket-chip" "sifive-blocks" "testchipip")
|
||||
dir="generators"
|
||||
|
||||
search
|
||||
|
||||
submodules=("esp-tools" "riscv-tools")
|
||||
dir="toolchains"
|
||||
|
||||
search
|
||||
|
||||
submodules=("barstools" "chisel3" "firrtl" "torture")
|
||||
dir="tools"
|
||||
|
||||
search
|
||||
|
||||
echo "Done checking all submodules"
|
||||
@@ -5,6 +5,22 @@ version: 2
|
||||
|
||||
# set of jobs to run
|
||||
jobs:
|
||||
commit-on-master-check:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Check commits of each submodule
|
||||
command: |
|
||||
.circleci/check-commit.sh
|
||||
|
||||
install-riscv-toolchain:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
@@ -470,6 +486,9 @@ workflows:
|
||||
version: 2
|
||||
build-and-test-rebar-integration:
|
||||
jobs:
|
||||
# check to make sure commits are on master
|
||||
- commit-on-master-check
|
||||
|
||||
# Make the toolchains
|
||||
- install-riscv-toolchain
|
||||
|
||||
|
||||
Reference in New Issue
Block a user