Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if submodule commits are on master #114

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .circleci/check-commit.sh
Original file line number Diff line number Diff line change
@@ -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
abejgonzalez marked this conversation as resolved.
Show resolved Hide resolved
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"
19 changes: 19 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down