From 5e64b734e1d23401f6ad908ef483dd63c79044fa Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Tue, 24 Sep 2024 07:06:42 +0200 Subject: [PATCH] Run CLI tests on GH actions --- .github/workflows/ci.yml | 18 +++++++++++++++++- cli-tests/cli-tests.sh | 8 +++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b30e6de8..ed97b55b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,4 +42,20 @@ jobs: cache: 'maven' - name: Test project with Maven - run: mvn --no-transfer-progress test package \ No newline at end of file + run: mvn --no-transfer-progress test package + + cli: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + + - name: Run CLI e2e tests + run: ./cli-tests/cli-tests.sh diff --git a/cli-tests/cli-tests.sh b/cli-tests/cli-tests.sh index 0ba02e50..3368c855 100755 --- a/cli-tests/cli-tests.sh +++ b/cli-tests/cli-tests.sh @@ -4,9 +4,11 @@ mvn clean package -DskipTests -Dmaven.source.skip=true -Dmaven.javadoc.skip=true # transformer-cli -cp onebusaway-gtfs-transformer-cli/target/onebusaway-gtfs-transformer-cli.jar ./transformer-cli.jar +TRANSFORMER_JAR="transformer-cli.jar" + +cp onebusaway-gtfs-transformer-cli/target/onebusaway-gtfs-transformer-cli.jar ./${TRANSFORMER_JAR} wget https://github.com/google/transit/blob/master/gtfs/spec/en/examples/sample-feed-1.zip?raw=true -O gtfs.zip -java -jar transformer-cli.jar --help +java -jar ${TRANSFORMER_JAR} --help -java -jar transformer-cli.jar --transform="{'op':'remove','match':{'file':'stops.txt','stop_id':'BEATTY_AIRPORT'}}" gtfs.zip gtfs.transformed.zip +java -jar ${TRANSFORMER_JAR} --transform="{'op':'remove','match':{'file':'stops.txt','stop_id':'BEATTY_AIRPORT'}}" gtfs.zip gtfs.transformed.zip