You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ko...@apache.org on 2021/01/01 16:00:18 UTC
[avro] branch master updated: AVRO-3009 Test in GitHub Actions
(#1043)
This is an automated email from the ASF dual-hosted git repository.
kojiromike pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/master by this push:
new 4467c66 AVRO-3009 Test in GitHub Actions (#1043)
4467c66 is described below
commit 4467c66e05abf0f3e3ad3570fca4a7769a13533b
Author: Michael A. Smith <mi...@smith-li.com>
AuthorDate: Fri Jan 1 12:00:05 2021 -0400
AVRO-3009 Test in GitHub Actions (#1043)
* AVRO-3009 GitHub Actions
* AVRO-3009: Rat Action
* AVRO-3009: Ruby Matrix
* AVRO-3009: Remove Unused Python Caching
* AVRO-3009: Disable TravisCI
---
lang/ruby/build.sh => .github/workflows/rat.yml | 69 +++++-----
.../workflows/test-lang-c++.yml | 46 ++++---
.github/workflows/test-lang-c.yml | 109 ++++++++++++++++
.github/workflows/test-lang-csharp.yml | 79 ++++++++++++
.github/workflows/test-lang-java.yml | 99 ++++++++++++++
.github/workflows/test-lang-js.yml | 108 ++++++++++++++++
.github/workflows/test-lang-perl.yml | 133 +++++++++++++++++++
.github/workflows/test-lang-php.yml | 142 +++++++++++++++++++++
.github/workflows/test-lang-py.yml | 133 +++++++++++++++++++
.github/workflows/test-lang-ruby.yml | 135 ++++++++++++++++++++
.travis.yml | 43 -------
.travis/before_install.sh | 41 ------
lang/php/build.sh | 1 +
lang/py/avro/test/test_bench.py | 9 +-
lang/py/build.sh | 4 +-
lang/ruby/build.sh | 8 +-
16 files changed, 1007 insertions(+), 152 deletions(-)
diff --git a/lang/ruby/build.sh b/.github/workflows/rat.yml
old mode 100755
new mode 100644
similarity index 53%
copy from lang/ruby/build.sh
copy to .github/workflows/rat.yml
index 701d4ed..9579712
--- a/lang/ruby/build.sh
+++ b/.github/workflows/rat.yml
@@ -1,5 +1,3 @@
-#!/bin/bash
-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
@@ -15,41 +13,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-set -e
-
-# connect to avro ruby root directory
-cd `dirname "$0"`
-
-# maintain our gems here
-export GEM_HOME=.gem/
-export PATH="$PATH:.gem/bin"
-
-# bootstrap bundler
-gem install --no-document -v 1.17.3 bundler
-bundle install
-
-for target in "$@"
-do
- case "$target" in
- lint)
- rubocop --lint
- ;;
-
- test)
- bundle exec rake test
- ;;
-
- dist)
- bundle exec rake dist
- ;;
-
- clean)
- bundle exec rake clean
- rm -rf tmp avro.gemspec data.avr
- ;;
-
- *)
- echo "Usage: $0 {lint|test|dist|clean}"
- exit 1
- esac
-done
+name: 'Rat'
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ rat:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Setup Java
+ uses: actions/setup-java@v1
+ with:
+ java-version: '11'
+
+ - name: Run Rat
+ run: mvn test -Dmaven.main.skip=true -Dmaven.test.skip=true -DskipTests=true -P rat -pl :avro-toplevel
diff --git a/.travis/script.sh b/.github/workflows/test-lang-c++.yml
old mode 100755
new mode 100644
similarity index 54%
rename from .travis/script.sh
rename to .github/workflows/test-lang-c++.yml
index 3082a73..c3c698d
--- a/.travis/script.sh
+++ b/.github/workflows/test-lang-c++.yml
@@ -1,5 +1,3 @@
-#!/bin/bash
-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
@@ -15,20 +13,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-set -e
+name: Test C++
+
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - 'lang/c\+\+/**'
+
+defaults:
+ run:
+ working-directory: lang/c++
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install Dependencies
+ run: sudo apt-get install -qqy cppcheck libboost-all-dev libsnappy-dev
+
+ - name: Lint
+ run: ./build.sh lint
-case "$TRAVIS_OS_NAME" in
-"linux")
- # Workaround for Yetus. For now, Yetus assumes the directory in which Dockerfile is placed is the docker context.
- # So the Dockerfile should be here to refer to other subdirectories than share/docker from inside the Dockerfile.
- cp share/docker/Dockerfile .
- /tmp/apache-yetus-0.10.0/bin/test-patch --plugins=buildtest --java-home=/usr/local/openjdk-"${JAVA}" --user-plugins=share/precommit/ --run-tests --empty-patch --docker --dockerfile=Dockerfile --dirty-workspace
- ;;
-"windows")
- ./lang/csharp/build.sh test
- ;;
-*)
- echo "Invalid PLATFORM"
- exit 1
- ;;
-esac
+ - name: Test
+ run: ./build.sh test
diff --git a/.github/workflows/test-lang-c.yml b/.github/workflows/test-lang-c.yml
new file mode 100644
index 0000000..a04731f
--- /dev/null
+++ b/.github/workflows/test-lang-c.yml
@@ -0,0 +1,109 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Test C
+
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/c/**
+
+defaults:
+ run:
+ working-directory: lang/c
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install Dependencies
+ run: sudo apt-get install -qqy libjansson-dev libsnappy-dev
+
+ - name: Lint
+ run: ./build.sh lint
+
+ - name: Test
+ run: ./build.sh test
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Generate Interop Data
+ run: ./build.sh interop-data-generate
+
+ - name: Run Interop Tests
+ run: ./build.sh interop-data-test
+
+ interop:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install Dependencies
+ run: |
+ sudo apt-get install -qqy --no-install-recommends libbz2-dev \
+ libjansson-dev \
+ liblzma-dev \
+ libsnappy-dev \
+ libzstd-dev
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Generate Interop Data
+ run: ./build.sh interop-data-generate
+
+ - name: Run Interop Tests
+ run: ./build.sh interop-data-test
diff --git a/.github/workflows/test-lang-csharp.yml b/.github/workflows/test-lang-csharp.yml
new file mode 100644
index 0000000..1db8294
--- /dev/null
+++ b/.github/workflows/test-lang-csharp.yml
@@ -0,0 +1,79 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Test C#'
+
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/csharp/**
+
+defaults:
+ run:
+ working-directory: lang/csharp
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: actions/cache@v2
+ with:
+ path: ~/.nuget/packages
+ key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-nuget-
+
+ - name: Lint
+ run: ./build.sh lint
+
+ - name: Test
+ run: ./build.sh test
+
+ interop:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Generate Interop Data
+ run: ./build.sh interop-data-generate
+
+ - name: Run Interop Tests
+ run: ./build.sh interop-data-test
diff --git a/.github/workflows/test-lang-java.yml b/.github/workflows/test-lang-java.yml
new file mode 100644
index 0000000..90471ad
--- /dev/null
+++ b/.github/workflows/test-lang-java.yml
@@ -0,0 +1,99 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Test Java'
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/java/**
+
+defaults:
+ run:
+ working-directory: lang/java
+
+jobs:
+ test:
+ name: Java ${{ matrix.java }} Test
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ java:
+ - '8'
+ - '11'
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Setup Java
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+
+ - name: Lint
+ run: ./build.sh lint
+
+ - name: Test
+ run: ./build.sh test
+
+ interop:
+ name: Java ${{ matrix.java }} Interop
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ java:
+ - '8'
+ - '11'
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Setup Java
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Run Interop Tests
+ working-directory: lang/java/ipc
+ run: mvn -B test -P interop-data-test
diff --git a/.github/workflows/test-lang-js.yml b/.github/workflows/test-lang-js.yml
new file mode 100644
index 0000000..4778b5d
--- /dev/null
+++ b/.github/workflows/test-lang-js.yml
@@ -0,0 +1,108 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Test JavaScript'
+
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/js/**
+
+defaults:
+ run:
+ working-directory: lang/js
+
+jobs:
+ test:
+ name: Node ${{ matrix.node }}
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node:
+ - 10
+ - 11
+ - 12
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup Node
+ uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node }}
+
+ - uses: actions/cache@v2
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-node-
+
+ - name: Lint
+ run: ./build.sh lint
+
+ - name: Test
+ run: ./build.sh test
+
+ interop:
+ name: Node ${{ matrix.node }} Interop
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node:
+ - 10
+ - 11
+ - 12
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup Node
+ uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node }}
+
+ - uses: actions/cache@v2
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-node-
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Generate Interop Data
+ run: ./build.sh interop-data-generate
+
+ - name: Run Interop Tests
+ run: npm install && ./build.sh interop-data-test
diff --git a/.github/workflows/test-lang-perl.yml b/.github/workflows/test-lang-perl.yml
new file mode 100644
index 0000000..1e2c045
--- /dev/null
+++ b/.github/workflows/test-lang-perl.yml
@@ -0,0 +1,133 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Test Perl'
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/perl/**
+
+defaults:
+ run:
+ working-directory: lang/perl
+
+jobs:
+ test:
+ name: Perl ${{ matrix.perl }} Tests
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ perl:
+ - '5.32'
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: shogo82148/actions-setup-perl@v1
+ with:
+ perl-version: ${{ matrix.perl }}
+
+ - name: Install Dependencies
+ run: |
+ sudo apt-get -qqy install --no-install-recommends libjansson-dev \
+ libcompress-raw-zlib-perl \
+ libcpan-uploader-perl \
+ libencode-perl \
+ libio-string-perl \
+ libjson-xs-perl \
+ libmodule-install-perl \
+ libmodule-install-readmefrompod-perl \
+ libobject-tiny-perl \
+ libperl-critic-perl \
+ libsnappy-dev \
+ libtest-exception-perl \
+ libtest-pod-perl
+ cpanm --mirror https://www.cpan.org/ install Compress::Zstd \
+ Error::Simple \
+ Module::Install::Repository \
+ Regexp::Common \
+ Try::Tiny \
+ inc::Module::Install
+
+ - name: Lint
+ run: ./build.sh lint
+
+ - name: Test
+ run: ./build.sh test
+
+ interop:
+ name: Perl ${{ matrix.perl }} Interop
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ perl:
+ - '5.32'
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: shogo82148/actions-setup-perl@v1
+ with:
+ perl-version: ${{ matrix.perl }}
+
+ - name: Install Dependencies
+ run: |
+ sudo apt-get -qqy install --no-install-recommends libcompress-raw-zlib-perl \
+ libcpan-uploader-perl \
+ libencode-perl \
+ libio-string-perl \
+ libjansson-dev \
+ libjson-xs-perl \
+ libmodule-install-perl \
+ libmodule-install-readmefrompod-perl \
+ libobject-tiny-perl \
+ libsnappy-dev \
+ libtest-exception-perl \
+ libtest-pod-perl
+ cpanm --mirror https://www.cpan.org/ install Compress::Zstd \
+ Error::Simple \
+ Module::Install::Repository \
+ Object::Tiny \
+ Regexp::Common \
+ Try::Tiny \
+ inc::Module::Install
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Generate Interop Data
+ run: ./build.sh interop-data-generate
+
+ - name: Run Interop Tests
+ run: ./build.sh interop-data-test
diff --git a/.github/workflows/test-lang-php.yml b/.github/workflows/test-lang-php.yml
new file mode 100644
index 0000000..1519193
--- /dev/null
+++ b/.github/workflows/test-lang-php.yml
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Test PHP'
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/php/**
+
+defaults:
+ run:
+ working-directory: lang/php
+
+jobs:
+ test:
+ name: PHP ${{ matrix.php }} Test
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php:
+ - '7.3'
+ - '7.4'
+ - '8.0'
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php }}
+
+ - name: Get Composer Cache Directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - uses: actions/cache@v2
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-composer-
+
+ - name: Lint
+ run: ./build.sh lint
+
+ - name: Test
+ run: ./build.sh test
+
+ interop:
+ name: PHP ${{ matrix.php }} Interop
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php:
+ - '7.3'
+ - '7.4'
+ - '8.0'
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php }}
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - uses: actions/checkout@v2
+ with:
+ repository: kjdev/php-ext-zstd
+ path: lang/php/php-ext-zstd
+
+ - name: Install php-ext-zstd
+ working-directory: lang/php/php-ext-zstd
+ run: |
+ sudo apt-get install -qqy --no-install-recommends libzstd-dev libbz2-dev
+ phpize
+ ./configure --with-libzstd
+ make
+ sudo make install
+ echo "extension=zstd.so" | sudo tee -a /etc/php/${{ matrix.php }}/cli/conf.d/10-zstd.ini
+ php -m
+
+ - uses: actions/checkout@v2
+ with:
+ repository: kjdev/php-ext-snappy
+ path: lang/php/php-ext-snappy
+ submodules: true
+
+
+ - name: Install php-ext-snappy
+ working-directory: lang/php/php-ext-snappy
+ run: |
+ sudo apt-get install -qqy --no-install-recommends libsnappy-dev
+ phpize
+ ./configure --with-libsnappy
+ make
+ sudo make install
+ echo "extension=snappy.so" | sudo tee -a /etc/php/${{ matrix.php }}/cli/conf.d/10-snappy.ini
+ php -m
+
+ - name: Generate Interop Data
+ run: ./build.sh interop-data-generate
+
+ - name: Run Interop Tests
+ run: ./build.sh test-interop
diff --git a/.github/workflows/test-lang-py.yml b/.github/workflows/test-lang-py.yml
new file mode 100644
index 0000000..f9272f9
--- /dev/null
+++ b/.github/workflows/test-lang-py.yml
@@ -0,0 +1,133 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Test Python'
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/py/**
+
+defaults:
+ run:
+ working-directory: lang/py
+
+jobs:
+ test:
+ name: Python ${{ matrix.python }} Tests
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ python:
+ - '3.6'
+ - '3.7'
+ - '3.8'
+ - '3.9'
+ - 'pypy-3.6'
+ - 'pypy-3.7'
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+
+ - name: Apt Install Compression Libs
+ run: |
+ sudo apt-get install -qqy --no-install-recommends libbz2-dev \
+ libjansson-dev \
+ liblzma-dev \
+ libsnappy-dev \
+ libzstd-dev
+
+ - name: Install Dependencies
+ run: |
+ python3 -m pip install --upgrade pip setuptools tox-wheel
+
+ - name: Lint
+ run: python3 -m tox -e lint
+
+ - name: Typechecks
+ if: "! startsWith(matrix.python, 'pypy-')"
+ run: python3 -m tox -e typechecks
+
+ - name: Test
+ run: python3 -m tox -e py
+
+ interop:
+ name: Python ${{ matrix.python }} Interop
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ python:
+ - '3.6'
+ - '3.7'
+ - '3.8'
+ - '3.9'
+ - 'pypy-3.6'
+ - 'pypy-3.7'
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+
+ - name: Apt Install Compression Libs
+ run: |
+ sudo apt-get install -qqy --no-install-recommends libbz2-dev \
+ libjansson-dev \
+ liblzma-dev \
+ libsnappy-dev \
+ libzstd-dev
+
+ - name: Install Dependencies
+ run: |
+ python3 -m pip install --upgrade pip setuptools tox-wheel
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Generate Interop Data
+ run: ./build.sh interop-data-generate
+
+ - name: Run Interop Tests
+ run: ./build.sh interop-data-test
diff --git a/.github/workflows/test-lang-ruby.yml b/.github/workflows/test-lang-ruby.yml
new file mode 100644
index 0000000..bb15817
--- /dev/null
+++ b/.github/workflows/test-lang-ruby.yml
@@ -0,0 +1,135 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Test Ruby'
+on:
+ workflow_dispatch:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ paths:
+ - lang/ruby/**
+
+defaults:
+ run:
+ working-directory: lang/ruby
+
+jobs:
+ test:
+ name: Ruby ${{ matrix.ruby }} Tests
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ ruby:
+ - '2.5'
+ - '2.6'
+ - '2.7'
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: actions/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+
+ - name: Install Dependencies
+ run: sudo apt-get install -qqy bundler libsnappy-dev
+
+ - uses: actions/cache@v2
+ with:
+ path: .gem
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-gems-
+
+ - name: Configure Bundler to Use Cache
+ run: bundle config path .gem
+
+ - name: Lint
+ run: |
+ PATH=$PWD/.gem/bin:$PATH
+ ./build.sh lint
+
+ - name: Test
+ run: |
+ PATH=$PWD/.gem/bin:$PATH
+ ./build.sh test
+
+ interop:
+ name: Ruby ${{ matrix.ruby }} Interop
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ ruby:
+ - '2.5'
+ - '2.6'
+ - '2.7'
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: actions/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+
+ - name: Install Dependencies
+ run: sudo apt-get install -qqy bundler libsnappy-dev
+
+ - uses: actions/cache@v2
+ with:
+ path: .gem
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-gems-
+
+ - name: Configure Bundler to Use Cache
+ run: bundle config path .gem
+
+ - name: Cache Local Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Install Java Avro for Interop Test
+ working-directory: .
+ run: mvn -B install -DskipTests
+
+ - name: Create Interop Data Directory
+ working-directory: .
+ run: mkdir -p build/interop/data
+
+ - name: Generate Interop Resources
+ working-directory: lang/java/avro
+ run: mvn -B -P interop-data-generate generate-resources
+
+ - name: Bundle Install
+ run: |
+ export GEM_HOME="$PWD/.gem/"
+ export PATH="$GEM_HOME/bin:$PATH"
+ bundle install
+
+ - name: Generate Interop Data
+ run: |
+ export GEM_HOME="$PWD/.gem/"
+ export PATH="$GEM_HOME/bin:$PATH"
+ bundle exec rake --trace generate_interop
+
+ - name: Run Interop Tests
+ run: |
+ export GEM_HOME="$PWD/.gem/"
+ export PATH="$GEM_HOME/bin:$PATH"
+ bundle exec rake --trace interop
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 4cd0cc4..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-sudo: required
-
-services:
- - docker
-
-matrix:
- include:
- - language: generic
- env:
- JAVA=8
-
- - language: generic
- env:
- JAVA=11
-
-# TODO(AVRO-2847): Travis Windows/C# build is sometimes flaky
-# - os: windows
-# language: bash
-
-before_install: "if [ -x ./.travis/before_install.sh ] ; then ./.travis/before_install.sh ; fi"
-install: "if [ -x ./.travis/install.sh ] ; then ./.travis/install.sh ; fi"
-before_script: "if [ -x ./.travis/before_script.sh ] ; then ./.travis/before_script.sh ; fi"
-script: "if [ -x ./.travis/script.sh ] ; then ./.travis/script.sh ; fi"
-after_script: "if [ -x ./.travis/after_script.sh ] ; then ./.travis/after_script.sh ; fi"
diff --git a/.travis/before_install.sh b/.travis/before_install.sh
deleted file mode 100755
index b5bd8ed..0000000
--- a/.travis/before_install.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-case "$TRAVIS_OS_NAME" in
-"linux")
- sudo apt-get -q update
- sudo apt-get -q install --no-install-recommends -y curl git gnupg-agent locales pinentry-curses pkg-config rsync software-properties-common
- sudo apt-get -q clean
- sudo rm -rf /var/lib/apt/lists/*
-
- # Only Yetus 0.9.0+ supports `ADD` and `COPY` commands in Dockerfile
- curl -L https://www-us.apache.org/dist/yetus/0.10.0/apache-yetus-0.10.0-bin.tar.gz | tar xvz -C /tmp/
- # A dirty workaround to disable the Yetus robot for TravisCI,
- # since it'll cancel the changes that .travis/script.sh will do,
- # even if the `--dirty-workspace` option is specified.
- rm /tmp/apache-yetus-0.10.0/lib/precommit/robots.d/travisci.sh
- ;;
-"windows")
- choco install dotnetcore-sdk --version 3.1.101
- ;;
-*)
- echo "Invalid PLATFORM"
- exit 1
- ;;
-esac
diff --git a/lang/php/build.sh b/lang/php/build.sh
index 3d1002e..d470e8b 100755
--- a/lang/php/build.sh
+++ b/lang/php/build.sh
@@ -48,6 +48,7 @@ for target in "$@"
do
case "$target" in
interop-data-generate)
+ composer install -d "../.."
php test/generate_interop_data.php
;;
diff --git a/lang/py/avro/test/test_bench.py b/lang/py/avro/test/test_bench.py
index 302e167..d0176bb 100644
--- a/lang/py/avro/test/test_bench.py
+++ b/lang/py/avro/test/test_bench.py
@@ -19,6 +19,7 @@
import argparse
import json
+import platform
import random
import string
import tempfile
@@ -43,18 +44,18 @@ SCHEMA = avro.schema.parse(json.dumps({
READER = avro.io.DatumReader(SCHEMA)
WRITER = avro.io.DatumWriter(SCHEMA)
NUMBER_OF_TESTS = 10000
-MAX_WRITE_SECONDS = 1
-MAX_READ_SECONDS = 1
+MAX_WRITE_SECONDS = 3 if platform.python_implementation() == 'PyPy' else 1
+MAX_READ_SECONDS = 3 if platform.python_implementation() == 'PyPy' else 1
class TestBench(unittest.TestCase):
def test_minimum_speed(self):
with tempfile.NamedTemporaryFile(suffix='avr') as temp:
pass
- self.assertTrue(time_writes(temp.name, NUMBER_OF_TESTS) < MAX_WRITE_SECONDS,
+ self.assertLess(time_writes(temp.name, NUMBER_OF_TESTS), MAX_WRITE_SECONDS,
'Took longer than {} second(s) to write the test file with {} values.'
.format(MAX_WRITE_SECONDS, NUMBER_OF_TESTS))
- self.assertTrue(time_read(temp.name) < MAX_READ_SECONDS,
+ self.assertLess(time_read(temp.name), MAX_READ_SECONDS,
'Took longer than {} second(s) to read the test file with {} values.'
.format(MAX_READ_SECONDS, NUMBER_OF_TESTS))
diff --git a/lang/py/build.sh b/lang/py/build.sh
index 0c4d1fc..eaf5aaa 100755
--- a/lang/py/build.sh
+++ b/lang/py/build.sh
@@ -54,11 +54,11 @@ interop-data-test() {
}
lint() {
- tox -e lint
+ python3 -m tox -e lint
}
test_() {
- TOX_SKIP_ENV=lint tox --skip-missing-interpreters
+ TOX_SKIP_ENV=lint python3 -m tox --skip-missing-interpreters
}
main() {
diff --git a/lang/ruby/build.sh b/lang/ruby/build.sh
index 701d4ed..3b51812 100755
--- a/lang/ruby/build.sh
+++ b/lang/ruby/build.sh
@@ -18,11 +18,11 @@
set -e
# connect to avro ruby root directory
-cd `dirname "$0"`
+cd "$(dirname "$0")"
# maintain our gems here
-export GEM_HOME=.gem/
-export PATH="$PATH:.gem/bin"
+export GEM_HOME="$PWD/.gem/"
+export PATH="$GEM_HOME/bin:$PATH"
# bootstrap bundler
gem install --no-document -v 1.17.3 bundler
@@ -32,7 +32,7 @@ for target in "$@"
do
case "$target" in
lint)
- rubocop --lint
+ bundle exec rubocop --lint
;;
test)