Skip to content

Commit

Permalink
Better support for different branches and running it locally
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyLandman committed Sep 11, 2024
1 parent 051b8a9 commit 44fad54
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/run-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,11 @@ jobs:
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'

- uses: actions/download-artifact@v4
with:
name: deps

- name: Download needed rascal-jar
run: mvn -B validate

- name: Typecheck rascal
run: |
java -jar rascal/rascal.jar Main \
Expand Down Expand Up @@ -130,7 +126,7 @@ jobs:
name: rascal-tpls
path: repos

- run: ls -alh
- run: tree repos/

- name: Typecheck rascal-libs
run: |
Expand Down
3 changes: 1 addition & 2 deletions run-all-single-thread.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ BIG_DIR ?= '|tmp:///big/|'
# make sure rascal.jar is present
mvn validate

# first we have to run rascal
java -jar target/dependencies/rascal.jar Main --repoFolder "$BIG_DIR" --clean
java -jar target/dependencies/rascal.jar Main --repoFolder "$BIG_DIR" --clean
19 changes: 16 additions & 3 deletions run-parallel-jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,34 @@ set -eo pipefail


CLEAN="--clean"
BIG_DIR="${BIG_DIR:=|tmp:///big/|}"
BIG_DIR="${BIG_DIR:=|tmp:///repo/|}"
EXTRA_ARGS=""

while getopts ":fd:" opt; do
while getopts ":fd:r:c:t:" opt; do
case ${opt} in
f)
CLEAN=""
;;
d)
BIG_DIR="${OPTARG}"
;;
r)
EXTRA_ARGS+="--rascalVersion ${OPTARG} "
;;
c)
EXTRA_ARGS+="--rascalCoreVersion ${OPTARG} "
;;
t)
EXTRA_ARGS+="--typepalVersion ${OPTARG} "
;;
?)
echo "Invalid option: -${OPTARG}."
echo "Available: "
echo "\t-f\tDo not remove tpls"
echo "\t-d <loc>\tOverride location where the repositories are stored and checked"
echo "\t-r <loc>\tOverride location of which rascal to use (should be a jar)"
echo "\t-c <loc>\tOverride location of which rascal-core to use"
echo "\t-t <loc>\tOverride location of which typepal to use"
exit 1
;;
esac
Expand All @@ -34,7 +47,7 @@ function runChecker() {
local name=$1
shift
echo "Starting $name, trail output $name.log (tail -f $name.log in different shell to check output)"
java -Drascal.monitor.batch -jar target/dependencies/rascal.jar Main --repoFolder "$BIG_DIR" $CLEAN --tests $@ >"$name.log" 2>&1 &
java -Drascal.monitor.batch -jar target/dependencies/rascal.jar Main --repoFolder "$BIG_DIR" $CLEAN $EXTRA_ARGS --tests $@ >"$name.log" 2>&1 &
}

## first we have to run rascal
Expand Down
6 changes: 3 additions & 3 deletions src/main/rascal/Main.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ int updateRepos(Projects projs, loc repoFolder, bool full) {
}
else {
println("**** Cloning <n>");
checkOutput("clone", execWithCode("git", args=["clone", *( full ? [] : ["--depth", "1"]), proj.repo.uri, n], workingDir=repoFolder));
checkOutput("switch", execWithCode("git", args=["switch", proj.branch], workingDir=targetFolder));
extraArgs = full ? [] : ["--single-branch", "--branch", proj.branch, "--depth", "1"];
checkOutput("clone", execWithCode("git", args=["clone", *extraArgs, proj.repo.uri, n], workingDir=repoFolder));
}
}
return result;
Expand All @@ -104,7 +104,7 @@ int main(
bool printWarnings = false, // print warnings in the final overview
bool full=true, // do a full clone
bool clean=true, // do a clean of the to build folders
loc repoFolder = |cwd:///|,
loc repoFolder = |tmp:///repo/|,
loc rascalVersion=|home:///.m2/repository/org/rascalmpl/rascal/0.40.7/rascal-0.40.7.jar|,
loc typepalVersion=|home:///.m2/repository/org/rascalmpl/typepal/0.14.0/typepal-0.14.0.jar|,
loc rascalCoreVersion=|home:///.m2/repository/org/rascalmpl/rascal-core/0.12.4/rascal-core-0.12.4.jar|,
Expand Down

0 comments on commit 44fad54

Please sign in to comment.