Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
b027b42
Add .circleci/config.yml
ericvergnaud Jan 23, 2021
63dc479
Merge branch 'master' into circleci-project-setup
ericvergnaud Jan 24, 2021
f0e5637
setup config
ericvergnaud Jan 24, 2021
500f947
use jdk8 image
ericvergnaud Jan 24, 2021
423c747
Updated config.yml
ericvergnaud Jan 24, 2021
16a270e
Updated config.yml
ericvergnaud Jan 24, 2021
4cd6713
Updated config.yml
ericvergnaud Jan 24, 2021
a786c85
more targets
ericvergnaud Jan 24, 2021
8f26188
Updated config.yml
ericvergnaud Jan 24, 2021
2cf7e54
update config
ericvergnaud Jan 24, 2021
2cbead8
update config
ericvergnaud Jan 24, 2021
c6c0aa2
update config
ericvergnaud Jan 24, 2021
f7252f0
update config
ericvergnaud Jan 24, 2021
4307a58
update config
ericvergnaud Jan 24, 2021
1e16b3c
Updated config.yml
ericvergnaud Jan 24, 2021
01dfb6a
Updated config.yml
ericvergnaud Jan 24, 2021
7f404f1
Updated config.yml
ericvergnaud Jan 24, 2021
60ddd05
update config
ericvergnaud Jan 24, 2021
578dc49
update config
ericvergnaud Jan 24, 2021
9d544f1
update config
ericvergnaud Jan 24, 2021
f9a52ef
update config
ericvergnaud Jan 24, 2021
c1b86ea
update config
ericvergnaud Jan 24, 2021
04b5e93
update config
ericvergnaud Jan 24, 2021
40fc25a
update config
ericvergnaud Jan 24, 2021
ff6690d
update config
ericvergnaud Jan 24, 2021
044972c
update config
ericvergnaud Jan 24, 2021
bf2cc4a
update config
ericvergnaud Jan 24, 2021
6f83e43
update config
ericvergnaud Jan 24, 2021
2671f4e
update config
ericvergnaud Jan 24, 2021
19a7a17
update config
ericvergnaud Jan 24, 2021
72aba47
update config
ericvergnaud Jan 24, 2021
faf783f
update config
ericvergnaud Jan 24, 2021
cb94a3b
update config
ericvergnaud Jan 24, 2021
547a668
update runtime version
ericvergnaud Jan 24, 2021
fc9f960
update config
ericvergnaud Jan 24, 2021
9b55bdf
update config
ericvergnaud Jan 24, 2021
18977fa
python3 config
ericvergnaud Jan 24, 2021
668ad57
update config
ericvergnaud Jan 24, 2021
c62d330
align Python2 and Python3 test hierarchy
ericvergnaud Jan 24, 2021
3388faa
update runtime version
ericvergnaud Jan 24, 2021
5317247
update config
ericvergnaud Jan 24, 2021
6dbd383
update config
ericvergnaud Jan 24, 2021
f5f5534
update config
ericvergnaud Jan 24, 2021
e1b52c2
update config
ericvergnaud Jan 24, 2021
99c3e58
explore dart issue
ericvergnaud Jan 24, 2021
56b43b5
update dart installer
ericvergnaud Jan 24, 2021
be3c439
update config
ericvergnaud Jan 24, 2021
6ba3979
update dart installer
ericvergnaud Jan 24, 2021
aa7cbaa
update config
ericvergnaud Jan 24, 2021
1c869a6
update config
ericvergnaud Jan 24, 2021
dacdf51
update config
ericvergnaud Jan 24, 2021
2f7db7c
update config
ericvergnaud Jan 24, 2021
33546d1
update config
ericvergnaud Jan 24, 2021
11acdb9
update config
ericvergnaud Jan 24, 2021
13a6da8
update config
ericvergnaud Jan 24, 2021
2b2bf73
update config
ericvergnaud Jan 25, 2021
e202a91
update config
ericvergnaud Jan 25, 2021
06b0b1c
update config
ericvergnaud Jan 25, 2021
ea5347e
update config
ericvergnaud Jan 25, 2021
e47449c
update config
ericvergnaud Jan 25, 2021
e46f850
update config
ericvergnaud Jan 25, 2021
b355bbf
update config
ericvergnaud Jan 25, 2021
c90a5c9
update config
ericvergnaud Jan 25, 2021
44fcaa0
update config
ericvergnaud Jan 25, 2021
4c8bd27
update config
ericvergnaud Jan 25, 2021
7a15db5
update config
ericvergnaud Jan 25, 2021
5b54602
update config
ericvergnaud Jan 25, 2021
87a62de
update config
ericvergnaud Jan 25, 2021
47729d8
update config
ericvergnaud Jan 25, 2021
95bc4b7
update config
ericvergnaud Jan 25, 2021
d26dfb5
update config
ericvergnaud Jan 25, 2021
2a12101
update config
ericvergnaud Jan 25, 2021
cad509e
update config
ericvergnaud Jan 25, 2021
26ca58c
update config
ericvergnaud Jan 25, 2021
3ec05b9
update config
ericvergnaud Jan 25, 2021
1d429d6
update config
ericvergnaud Jan 25, 2021
568883a
use sudo on circle ci
ericvergnaud Jan 25, 2021
aafc8cd
update config
ericvergnaud Jan 25, 2021
5a72e78
update config
ericvergnaud Jan 25, 2021
abe1bc9
update config
ericvergnaud Jan 25, 2021
2aa5802
update config
ericvergnaud Jan 25, 2021
971fc60
update config
ericvergnaud Jan 25, 2021
2619a58
update config
ericvergnaud Jan 25, 2021
7b5790e
update config
ericvergnaud Jan 25, 2021
dadae97
update config
ericvergnaud Jan 25, 2021
5b64564
update config
ericvergnaud Jan 25, 2021
e0e6040
update config
ericvergnaud Jan 25, 2021
1a3e89b
update config
ericvergnaud Jan 25, 2021
82e5c2d
update config
ericvergnaud Jan 25, 2021
f0a80de
update config
ericvergnaud Jan 25, 2021
fb96344
update config
ericvergnaud Jan 25, 2021
bd1823b
update config
ericvergnaud Jan 25, 2021
4844981
update config
ericvergnaud Jan 25, 2021
30a9eca
update config
ericvergnaud Jan 25, 2021
e963d11
update config
ericvergnaud Jan 25, 2021
bce8371
update config
ericvergnaud Jan 25, 2021
d2aab21
update config
ericvergnaud Jan 25, 2021
e3e6160
update config
ericvergnaud Jan 25, 2021
cb1ac69
update config
ericvergnaud Jan 25, 2021
b5108a4
update config
ericvergnaud Jan 25, 2021
70f8b2e
update config
ericvergnaud Jan 25, 2021
f294d9a
update config
ericvergnaud Jan 25, 2021
ad08090
update config
ericvergnaud Jan 25, 2021
37b3c29
update config
ericvergnaud Jan 25, 2021
d2925d4
update config
ericvergnaud Jan 25, 2021
4f70a84
update config
ericvergnaud Jan 25, 2021
8cfa0ec
update config
ericvergnaud Jan 25, 2021
fa7f19f
update config
ericvergnaud Jan 25, 2021
c988e0c
update config
ericvergnaud Jan 25, 2021
ebfa5ce
update config
ericvergnaud Jan 25, 2021
d166aa6
update config
ericvergnaud Jan 25, 2021
31bf193
update config
ericvergnaud Jan 25, 2021
0f7e7cb
update config
ericvergnaud Jan 25, 2021
261b9ec
update config
ericvergnaud Jan 25, 2021
5489448
update config
ericvergnaud Jan 25, 2021
61e317a
update config
ericvergnaud Jan 25, 2021
c054686
update config
ericvergnaud Jan 25, 2021
a4f0995
update config
ericvergnaud Jan 25, 2021
a52d4eb
update config
ericvergnaud Jan 25, 2021
882eda3
update config
ericvergnaud Jan 25, 2021
41b7cbb
update config
ericvergnaud Jan 25, 2021
bb8bb41
update config
ericvergnaud Jan 25, 2021
3a3742c
update config
ericvergnaud Jan 25, 2021
2cfa468
update config
ericvergnaud Jan 25, 2021
fc18ab7
update config
ericvergnaud Jan 26, 2021
6e16543
Fix NPE
ericvergnaud Jan 26, 2021
2b488de
update config
ericvergnaud Jan 26, 2021
fdc7540
update config
ericvergnaud Jan 26, 2021
a5bf86d
update config
ericvergnaud Jan 26, 2021
13472df
update config
ericvergnaud Jan 26, 2021
866ee71
update config
ericvergnaud Jan 26, 2021
a9a4f49
update config
ericvergnaud Jan 26, 2021
0c20af5
update config
ericvergnaud Jan 26, 2021
c769fcc
update config
ericvergnaud Jan 26, 2021
77876cb
update config
ericvergnaud Jan 26, 2021
3327408
update config
ericvergnaud Jan 26, 2021
501cccd
update config
ericvergnaud Jan 26, 2021
1542152
update config
ericvergnaud Jan 26, 2021
a24317b
update config
ericvergnaud Jan 26, 2021
a6018d1
update config
ericvergnaud Jan 26, 2021
4913b99
update config
ericvergnaud Jan 26, 2021
dc7e62d
update config
ericvergnaud Jan 26, 2021
d32c0ca
update config
ericvergnaud Jan 26, 2021
1a5c781
more consistent badges
ericvergnaud Jan 26, 2021
c169eb2
do not parallelize tests on circle-ci
ericvergnaud Jan 26, 2021
51b7389
Merge branch 'fix-npe-in-tests' into circleci-project-setup
ericvergnaud Jan 26, 2021
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
66 changes: 66 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: 2.1

jobs:
test_tool_and_runtime_java:
docker:
- image: cimg/openjdk:8.0
steps:
- checkout
- run:
name: build tool
command: mvn -B -V -DskipTests=true -Dmaven.javadoc.skip=true install
- run:
name: test runtime
command: |
cd runtime-testsuite
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=java.* test
cd ..
- run:
name: test tool
command: |
cd tool-testsuite
mvn -q -Dparallel=methods -DthreadCount=4 test
cd ..
test_runtime:
parameters:
test-group:
description: The section
type: string
default: ALL
target:
description: The target
type: string
default: java
docker:
- image: cimg/openjdk:8.0
environment:
TARGET: << parameters.target >>
GROUP: << parameters.test-group >>
steps:
- checkout
- run:
name: Install << parameters.target >> pre-requisites
command: |
f=".circleci/scripts/install-linux-<< parameters.target >>.sh"; ! [ -x "$f" ] || "$f"
- run:
name: Build ANTLR4 tool
command: mvn -B -V -DskipTests=true -Dmaven.javadoc.skip=true install
- run:
name: Test << parameters.target >> runtime
command: |
.circleci/scripts/run-tests-<< parameters.target >>.sh

workflows:
build:
jobs:
- test_tool_and_runtime_java
- test_runtime:
matrix:
parameters:
target: [ dart, go, python2, python3, javascript ]
- test_runtime:
matrix:
parameters:
# target: [ cpp, dotnet, swift ]
target: [ cpp, dotnet ]
test-group: [ LEXER, PARSER, RECURSION ]
35 changes: 35 additions & 0 deletions .circleci/scripts/install-linux-cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -euo pipefail

echo "installing cpp SDK..."

sudo apt-get update -y
sudo apt-get install -y clang
sudo apt-get install -y cmake
sudo apt-get install -y pkg-config
sudo apt-get install -y uuid-dev

echo "done installing cpp SDK"

clang++ --version
cmake --version

echo "building cpp runtime..."

pushd "runtime/Cpp/"
echo $PWD
rc=0
if [ $rc == 0 ]; then
cmake . -DCMAKE_BUILD_TYPE=release
rc=$?
fi
if [ $rc == 0 ]; then
make -j 8
rc=$?
fi
popd


echo "done building cpp runtime"

14 changes: 14 additions & 0 deletions .circleci/scripts/install-linux-dart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -euo pipefail

echo "installing dart SDK..."
sudo apt-get update
sudo apt-get install apt-transport-https
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update
sudo apt-get install dart=2.8.4-1
export PATH="$PATH:/usr/lib/dart/bin"
echo "done installing dart SDK"
sudo apt-get install -f
19 changes: 19 additions & 0 deletions .circleci/scripts/install-linux-dotnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -euo pipefail

echo "installing .Net SDK..."
wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-3.1
export PATH=$PATH:~/.dotnet
echo "done installing .Net SDK"

# 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
echo "building runtime..."
dotnet build -c Release -f netstandard2.0 runtime/CSharp/Antlr4.csproj
echo "done building runtime"
9 changes: 9 additions & 0 deletions .circleci/scripts/install-linux-go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -euo pipefail

echo "installing go SDK..."
sudo apt update
sudo apt install golang-go
go version
echo "done installing go SDK"
17 changes: 17 additions & 0 deletions .circleci/scripts/install-linux-javascript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -euo pipefail

# use v14 and check
echo "installing nodejs..."
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
echo node version: $(node --version)
echo "done installing nodejs..."

echo "packaging javascript runtime..."
pushd runtime/JavaScript
sudo npm install
sudo npm link
popd
echo "done packaging javascript runtime"
24 changes: 24 additions & 0 deletions .circleci/scripts/install-linux-libcurl3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

echo "before patching"
ls -all /lib/x86_64-linux-gnu/ | grep libcurl

# This would fix missing CURL_OPENSSL_3
# use a dedicated temp dir in the user space
mkdir ~/libcurl3
cd ~/libcurl3
# fetch latest libcurl3
wget http://archive.ubuntu.com/ubuntu/pool/main/c/curl/libcurl3_7.47.0-1ubuntu2_amd64.deb
# extract data.tar.xz
ar x libcurl3* data.tar.xz
# extract all from data.tar.xz
tar xf data.tar.xz
# copy libcurl.so.3 where required
sudo cp -L ~/libcurl3/usr/lib/x86_64-linux-gnu/libcurl.so.4.4.0 /lib/x86_64-linux-gnu/libcurl.so.4.4.0
sudo ln -sf libcurl.so.4.4.0 /lib/x86_64-linux-gnu/libcurl.so.4
cd ..
# drop dedicated temp dir
sudo rm -rf ~/libcurl3

echo "after patching"
ls -all /lib/x86_64-linux-gnu/ | grep libcurl
11 changes: 11 additions & 0 deletions .circleci/scripts/install-linux-php.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt-get update -qq

php -v

git clone https://github.com/antlr/antlr-php-runtime.git
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
8 changes: 8 additions & 0 deletions .circleci/scripts/install-linux-python2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -euo pipefail

echo "installing python 2..."
sudo apt-get update -y
sudo apt-get install python2
echo "done installing python 2"
8 changes: 8 additions & 0 deletions .circleci/scripts/install-linux-python3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -euo pipefail

echo "installing python 3..."
sudo apt-get update -y
sudo apt-get install python3
echo "done installing python 3"
36 changes: 36 additions & 0 deletions .circleci/scripts/install-linux-swift.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -euo pipefail

echo "installing swift SDK..."

.circleci/scripts/install-linux-libcurl3.sh

# see https://tecadmin.net/install-swift-ubuntu-1604-xenial/
sudo apt-get update -y
sudo apt-get install clang libicu-dev
sudo apt-get install libpython2.7 libpython2.7-dev

export SWIFT_VERSION=swift-5.3.2
echo "installing gpg key..."
wget -q -O - https://swift.org/keys/all-keys.asc | sudo gpg --import -
echo "downloading SDK gpg key..."
SWIFT_SDK=https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1604/$SWIFT_VERSION-RELEASE/$SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz
echo $SWIFT_SDK
wget -q $SWIFT_SDK
sudo tar xzf $SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz
mv $SWIFT_VERSION-RELEASE-ubuntu16.04 $PWD/swift

export SWIFT_HOME=$PWD/swift/$SWIFT_VERSION-RELEASE-ubuntu16.04/usr/bin/
export PATH=$PWD/swift/usr/bin:$PATH

# This would fix a know linker issue mentioned in: # https://bugs.swift.org/browse/SR-2299
sudo ln -sf ld.gold /usr/bin/ld
# This would fix missing libtinfo.so.5
sudo apt install libncurses5

echo "done installing swift SDK..."

# check swift
swift --version
swift build --version
17 changes: 17 additions & 0 deletions .circleci/scripts/run-tests-cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -euo pipefail

pushd runtime-testsuite
echo "running maven tests..."
if [ $GROUP == "LEXER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=cpp.* test
elif [ $GROUP == "PARSER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=cpp.* test
elif [ $GROUP == "RECURSION" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=cpp.* test
else
mvn -q -Dtest=cpp.* test
fi
popd

11 changes: 11 additions & 0 deletions .circleci/scripts/run-tests-dart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

dart --version

pushd runtime-testsuite
echo "running maven tests..."
# mvn -q -Dparallel=classes -DthreadCount=4 -Dtest=dart.* test
mvn -q -Dtest=dart.* test
popd
16 changes: 16 additions & 0 deletions .circleci/scripts/run-tests-dotnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -euo pipefail

pushd runtime-testsuite/
echo "running maven tests..."
if [ $GROUP == "LEXER" ]; then
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" -Dtest=csharp.* test
elif [ $GROUP == "RECURSION" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=csharp.* test
else
mvn -q -Dtest=csharp.* test
fi
popd
10 changes: 10 additions & 0 deletions .circleci/scripts/run-tests-go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -euo pipefail

go version

pushd runtime-testsuite
echo "running maven tests..."
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=go.* test
popd
8 changes: 8 additions & 0 deletions .circleci/scripts/run-tests-javascript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -euo pipefail

pushd runtime-testsuite
echo "running maven tests..."
mvn -q -Dtest=javascript.* test
popd
9 changes: 9 additions & 0 deletions .circleci/scripts/run-tests-php.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -euo pipefail

php_path=$(which php)

composer install -d ../runtime/PHP

mvn -q -DPHP_PATH="${php_path}" -Dparallel=methods -DthreadCount=4 -Dtest=php.* test
24 changes: 24 additions & 0 deletions .circleci/scripts/run-tests-python2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -euo pipefail

python2 --version

pushd runtime/Python2/tests
echo "running native tests..."
python2 run.py
rc=$?
if [ $rc != 0 ]; then
echo "failed running native tests"
fi
popd

if [ $rc == 0 ]; then
pushd runtime-testsuite
echo "running maven tests..."
mvn -q -Dtest=python2.* test
rc=$?
popd
fi

# return $rc
24 changes: 24 additions & 0 deletions .circleci/scripts/run-tests-python3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -euo pipefail

python3 --version

pushd runtime/Python3/tests
echo "running native tests..."
python3 run.py
rc=$?
if [ $rc != 0 ]; then
echo "failed running native tests"
fi
popd

if [ $rc == 0 ]; then
pushd runtime-testsuite
echo "running maven tests..."
mvn -q -Dtest=python3.* test
rc=$?
popd
fi

# return $rc
Loading