From daf633643003969bd921c6081baee6628d3363ff Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 16:50:50 +0800 Subject: [PATCH 1/8] add script --- .github/scripts/run-tests-dotnet.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .github/scripts/run-tests-dotnet.sh diff --git a/.github/scripts/run-tests-dotnet.sh b/.github/scripts/run-tests-dotnet.sh new file mode 100755 index 0000000000..de8c046e00 --- /dev/null +++ b/.github/scripts/run-tests-dotnet.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -euo pipefail + +# we need to build the runtime before test run, since we used "--no-dependencies" +# when we call dotnet cli for restore and build, in order to speed up + +dotnet build -c Release -f netstandard2.0 ../runtime/CSharp/Antlr4.csproj + +# call test + +if [ $GROUP == "LEXER" ]; then + mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test +elif [ $GROUP == "PARSER" ]; then + mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test +elif [ $GROUP == "RECURSION" ]; then + mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test +else + mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=csharp.* test +fi From 0caddd86342c3a8d98ae3bc506ee273997c34a13 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 17:29:12 +0800 Subject: [PATCH 2/8] add dotnet path --- .github/scripts/mac-action-runner-readme.txt | 6 +++++- .github/scripts/run-tests-dotnet.sh | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/scripts/mac-action-runner-readme.txt b/.github/scripts/mac-action-runner-readme.txt index 1cf46a42e5..f6aa39d776 100644 --- a/.github/scripts/mac-action-runner-readme.txt +++ b/.github/scripts/mac-action-runner-readme.txt @@ -23,4 +23,8 @@ JDK (we need a specific JDK): sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefpane C++: - - brew install cmake \ No newline at end of file + - brew install cmake + +C#: + - .github/scripts/install-dotnet-on-osx.sh + (you need to repeat this step for each user account) \ No newline at end of file diff --git a/.github/scripts/run-tests-dotnet.sh b/.github/scripts/run-tests-dotnet.sh index de8c046e00..17f1e6d655 100755 --- a/.github/scripts/run-tests-dotnet.sh +++ b/.github/scripts/run-tests-dotnet.sh @@ -2,6 +2,8 @@ set -euo pipefail +export PATH=$PATH:~/.dotnet + # we need to build the runtime before test run, since we used "--no-dependencies" # when we call dotnet cli for restore and build, in order to speed up From 92f4c0707b98fac6c2dc462a0125bae835d12667 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 17:32:24 +0800 Subject: [PATCH 3/8] fix cd --- .github/scripts/run-tests-dotnet.sh | 3 ++- .github/scripts/run-tests-java.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/run-tests-dotnet.sh b/.github/scripts/run-tests-dotnet.sh index 17f1e6d655..ae4efae8f2 100755 --- a/.github/scripts/run-tests-dotnet.sh +++ b/.github/scripts/run-tests-dotnet.sh @@ -9,7 +9,8 @@ export PATH=$PATH:~/.dotnet dotnet build -c Release -f netstandard2.0 ../runtime/CSharp/Antlr4.csproj -# call test +# run tests +cd runtime-testsuite/ if [ $GROUP == "LEXER" ]; then mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test diff --git a/.github/scripts/run-tests-java.sh b/.github/scripts/run-tests-java.sh index 678581bf17..f076fc3dcf 100755 --- a/.github/scripts/run-tests-java.sh +++ b/.github/scripts/run-tests-java.sh @@ -11,6 +11,7 @@ fi # run java tests cd runtime-testsuite/ + if [ $GROUP == "LEXER" ]; then mvn -X -e -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest="swift.*" test elif [ $GROUP == "PARSER" ]; then From a5589d0dabe0dac61834dc92046bcf2f71a8e405 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 17:34:59 +0800 Subject: [PATCH 4/8] fix cd --- .github/scripts/run-tests-dotnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/run-tests-dotnet.sh b/.github/scripts/run-tests-dotnet.sh index ae4efae8f2..aa6f196a79 100755 --- a/.github/scripts/run-tests-dotnet.sh +++ b/.github/scripts/run-tests-dotnet.sh @@ -7,7 +7,7 @@ export PATH=$PATH:~/.dotnet # we need to build the runtime before test run, since we used "--no-dependencies" # when we call dotnet cli for restore and build, in order to speed up -dotnet build -c Release -f netstandard2.0 ../runtime/CSharp/Antlr4.csproj +dotnet build -c Release -f netstandard2.0 runtime/CSharp/Antlr4.csproj # run tests cd runtime-testsuite/ From 0fa457a36ea818cab2ce7736fb330fca3adcd6b0 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 17:45:41 +0800 Subject: [PATCH 5/8] avoid concurrency --- .github/scripts/run-tests-dotnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/run-tests-dotnet.sh b/.github/scripts/run-tests-dotnet.sh index aa6f196a79..39055c3ac3 100755 --- a/.github/scripts/run-tests-dotnet.sh +++ b/.github/scripts/run-tests-dotnet.sh @@ -13,11 +13,11 @@ dotnet build -c Release -f netstandard2.0 runtime/CSharp/Antlr4.csproj cd runtime-testsuite/ if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test + mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=csharp.* test elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test + mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=csharp.* test elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test + mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=csharp.* test else - mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=csharp.* test + mvn -q -Dtest=csharp.* test fi From b3542834a5309c154976478a208ea2484b3923cd Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 17:55:49 +0800 Subject: [PATCH 6/8] add Github action badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44cbf62a8c..cd9d7c2eef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ANTLR v4 -[![Build Travis-CI Status](https://travis-ci.org/antlr/antlr4.svg?branch=master)](https://travis-ci.org/antlr/antlr4) [![Build AppVeyor Status](https://ci.appveyor.com/api/projects/status/5acpbx1pg7bhgh8v/branch/master?svg=true)](https://ci.appveyor.com/project/parrt/antlr4) [![Java 7+](https://img.shields.io/badge/java-7+-4c7e9f.svg)](http://java.oracle.com) [![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt) +[![Github Build Status (MacOSX)](https://github.com/antlr/antlr4/workflows/MacOSX/badge.svg)](https://github.com/antlr/antlr4/actions) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/5acpbx1pg7bhgh8v/branch/master?svg=true)](https://ci.appveyor.com/project/parrt/antlr4) [![Java 7+](https://img.shields.io/badge/java-7+-4c7e9f.svg)](http://java.oracle.com) [![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt) **ANTLR** (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface (or visitor) that makes it easy to respond to the recognition of phrases of interest. From 6a7c3ad256e6f7486a4857c678b311d1d3f8a375 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 17:57:40 +0800 Subject: [PATCH 7/8] more feedback --- .../test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java | 1 + .../test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java | 1 + 2 files changed, 2 insertions(+) diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java index 03895f55a9..2d9579a82d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java @@ -114,6 +114,7 @@ public void testTearDown() throws Exception { @Override public void beforeTest(RuntimeTestDescriptor descriptor) { + System.out.println(descriptor.getTestName()); } @Override diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java index 5fbd97ecfb..a14067ee45 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java @@ -142,6 +142,7 @@ public void testTearDown() throws Exception { @Override public void beforeTest(RuntimeTestDescriptor descriptor) { + System.out.println(descriptor.getTestName()); } @Override From 4830925ab0021ba362920bdd0eacfb6b76db74f1 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 24 Jan 2021 17:59:35 +0800 Subject: [PATCH 8/8] reinstate all builds --- .github/workflows/java-all.yml | 28 ---------------------------- .github/workflows/macosx.yml | 6 ++---- 2 files changed, 2 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/java-all.yml diff --git a/.github/workflows/java-all.yml b/.github/workflows/java-all.yml deleted file mode 100644 index 34cdb8b469..0000000000 --- a/.github/workflows/java-all.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Java/MacOSX - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: [self-hosted, macOS, x64] - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Set up Maven - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.5.4 - - name: Build tool with Maven - run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V - - name: Test with Maven - run: .github/scripts/run-tests-java.sh - env: - TARGET: swift - GROUP: ALL diff --git a/.github/workflows/macosx.yml b/.github/workflows/macosx.yml index 5bae5b7237..cbce1a2ee2 100644 --- a/.github/workflows/macosx.yml +++ b/.github/workflows/macosx.yml @@ -12,10 +12,8 @@ jobs: strategy: fail-fast: false matrix: - # GROUP: [LEXER, PARSER, RECURSION] - # TARGET: [swift, cpp, dotnet] - GROUP: [LEXER] - TARGET: [dotnet] + GROUP: [LEXER, PARSER, RECURSION] + TARGET: [swift, cpp, dotnet] steps: - uses: actions/checkout@v2 - name: Set up JDK 1.8