| 1 |
# Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 |
# contributor license agreements. See the NOTICE file distributed with |
| 3 |
# this work for additional information regarding copyright ownership. |
| 4 |
# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 |
# (the "License"); you may not use this file except in compliance with |
| 6 |
# the License. You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# https://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
|
| 16 |
name: 'Test Perl' |
| 17 |
on: |
| 18 |
workflow_dispatch: |
| 19 |
push: |
| 20 |
branches: [ main ] |
| 21 |
pull_request: |
| 22 |
branches: [ main ] |
| 23 |
paths: |
| 24 |
- .github/workflows/test-lang-perl.yml |
| 25 |
- lang/perl/** |
| 26 |
|
| 27 |
defaults: |
| 28 |
run: |
| 29 |
working-directory: lang/perl |
| 30 |
|
| 31 |
concurrency: |
| 32 |
group: ${{ github.workflow }}-${{ github.ref }} |
| 33 |
cancel-in-progress: true |
| 34 |
|
| 35 |
jobs: |
| 36 |
test: |
| 37 |
runs-on: ${{ matrix.os }} |
| 38 |
strategy: |
| 39 |
matrix: |
| 40 |
os: |
| 41 |
- ubuntu-latest |
| 42 |
- ubuntu-24.04-arm |
| 43 |
perl: |
| 44 |
- '5.32' |
| 45 |
steps: |
| 46 |
- uses: actions/checkout@v5 |
| 47 |
|
| 48 |
- uses: shogo82148/actions-setup-perl@v1 |
| 49 |
with: |
| 50 |
perl-version: ${{ matrix.perl }} |
| 51 |
|
| 52 |
- name: Install Dependencies |
| 53 |
run: | |
| 54 |
cpanm --mirror https://www.cpan.org/ install Compress::Zstd \ |
| 55 |
Encode \ |
| 56 |
Error::Simple \ |
| 57 |
JSON::MaybeXS \ |
| 58 |
Module::Install \ |
| 59 |
Module::Install::ReadmeFromPod \ |
| 60 |
Object::Tiny \ |
| 61 |
Perl::Critic \ |
| 62 |
Regexp::Common \ |
| 63 |
Test::Exception \ |
| 64 |
Test::More \ |
| 65 |
Test::Pod \ |
| 66 |
Try::Tiny |
| 67 |
|
| 68 |
- name: Lint |
| 69 |
run: ./build.sh lint |
| 70 |
|
| 71 |
- name: Test |
| 72 |
run: ./build.sh test |
| 73 |
|
| 74 |
interop: |
| 75 |
runs-on: ${{ matrix.os }} |
| 76 |
strategy: |
| 77 |
matrix: |
| 78 |
os: |
| 79 |
- ubuntu-latest |
| 80 |
- ubuntu-24.04-arm |
| 81 |
perl: |
| 82 |
- '5.32' |
| 83 |
steps: |
| 84 |
- uses: actions/checkout@v5 |
| 85 |
|
| 86 |
- uses: shogo82148/actions-setup-perl@v1 |
| 87 |
with: |
| 88 |
perl-version: ${{ matrix.perl }} |
| 89 |
|
| 90 |
- name: Install Dependencies |
| 91 |
run: | |
| 92 |
sudo apt-get update && \ |
| 93 |
sudo apt-get -qqy install --no-install-recommends libjansson-dev \ |
| 94 |
libsnappy-dev |
| 95 |
cpanm --mirror https://www.cpan.org/ install Compress::Zstd \ |
| 96 |
Encode \ |
| 97 |
Error::Simple \ |
| 98 |
JSON::MaybeXS \ |
| 99 |
Module::Install \ |
| 100 |
Module::Install::ReadmeFromPod \ |
| 101 |
Object::Tiny \ |
| 102 |
Regexp::Common \ |
| 103 |
Test::Exception \ |
| 104 |
Test::More \ |
| 105 |
Test::Pod \ |
| 106 |
Try::Tiny |
| 107 |
|
| 108 |
- name: Cache Local Maven Repository |
| 109 |
uses: actions/cache@v4 |
| 110 |
with: |
| 111 |
path: ~/.m2/repository |
| 112 |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 113 |
restore-keys: | |
| 114 |
${{ runner.os }}-maven- |
| 115 |
|
| 116 |
- name: 'Setup Temurin JDK 8, 11, 17 & 21' |
| 117 |
uses: actions/setup-java@v5 |
| 118 |
with: |
| 119 |
distribution: 'temurin' |
| 120 |
java-version: | |
| 121 |
8 |
| 122 |
11 |
| 123 |
17 |
| 124 |
21 |
| 125 |
|
| 126 |
- name: 'Setup Maven 3.9.6' |
| 127 |
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5 |
| 128 |
with: |
| 129 |
maven-version: 3.9.6 |
| 130 |
|
| 131 |
- name: Install Java Avro for Interop Test |
| 132 |
working-directory: . |
| 133 |
run: mvn -B install -PskipQuality |
| 134 |
|
| 135 |
- name: Create Interop Data Directory |
| 136 |
working-directory: . |
| 137 |
run: mkdir -p build/interop/data |
| 138 |
|
| 139 |
- name: Generate Interop Resources |
| 140 |
working-directory: lang/java/avro |
| 141 |
run: mvn -B -P interop-data-generate generate-resources |
| 142 |
|
| 143 |
- name: Generate Interop Data |
| 144 |
run: ./build.sh interop-data-generate |
| 145 |
|
| 146 |
- name: Run Interop Tests |
| 147 |
run: ./build.sh interop-data-test |