From eb93ace725e7db0324f16ddea85dc78d79436a0c Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Sun, 2 Jun 2019 23:25:51 -0700 Subject: [PATCH] check if commit is on master --- .circleci/check-commit.sh | 40 +++++++++++++++++++++++++++++++++++++++ .circleci/config.yml | 19 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100755 .circleci/check-commit.sh diff --git a/.circleci/check-commit.sh b/.circleci/check-commit.sh new file mode 100755 index 00000000..7b0ec9e5 --- /dev/null +++ b/.circleci/check-commit.sh @@ -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" diff --git a/.circleci/config.yml b/.circleci/config.yml index d2354fde..0f982233 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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