Debian Codegraph @

.github/workflows/test-lang-py.yml

raw
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 Python'
17 on:
18 workflow_dispatch:
19 push:
20 branches: [ main ]
21 pull_request:
22 branches: [ main ]
23 paths:
24 - .github/workflows/test-lang-py.yml
25 - lang/py/**
26
27 defaults:
28 run:
29 working-directory: lang/py
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 fail-fast: false
40 matrix:
41 os:
42 - ubuntu-latest
43 - ubuntu-24.04-arm
44 python:
45 - '3.13'
46 - '3.12'
47 - '3.11'
48 - '3.10'
49 - '3.9'
50 - 'pypy-3.11'
51 - 'pypy-3.10'
52
53 steps:
54 - uses: actions/checkout@v5
55
56 - name: Setup Python
57 uses: actions/setup-python@v5
58 with:
59 python-version: ${{ matrix.python }}
60
61 - name: Apt Install Compression Libs
62 run: |
63 sudo apt-get update && \
64 sudo apt-get install -qqy --no-install-recommends libbz2-dev \
65 libjansson-dev \
66 liblzma-dev \
67 libsnappy-dev \
68 libzstd-dev
69
70 - name: Install Dependencies
71 run: |
72 python3 -m pip install --upgrade pip setuptools tox
73
74 - name: Lint
75 if: ${{ matrix.python == '3.13' }}
76 run: python3 -m tox -e lint
77
78 - name: Typechecks
79 if: ${{ matrix.python == '3.13' }}
80 run: python3 -m tox -e typechecks
81
82 - name: Test
83 run: python3 -m tox -e py
84
85 interop:
86 runs-on: ${{ matrix.os }}
87 strategy:
88 fail-fast: false
89 matrix:
90 os:
91 - ubuntu-latest
92 - ubuntu-24.04-arm
93 python:
94 - '3.13'
95 - '3.12'
96 - '3.11'
97 - '3.10'
98 - '3.9'
99 - 'pypy-3.11'
100 - 'pypy-3.10'
101
102 steps:
103 - uses: actions/checkout@v5
104
105 - name: Setup Python
106 uses: actions/setup-python@v5
107 with:
108 python-version: ${{ matrix.python }}
109
110 - name: Apt Install Compression Libs
111 run: |
112 sudo apt-get update && \
113 sudo apt-get install -qqy --no-install-recommends libbz2-dev \
114 libjansson-dev \
115 liblzma-dev \
116 libsnappy-dev \
117 libzstd-dev
118
119 - name: Install Dependencies
120 run: |
121 python3 -m pip install --upgrade pip setuptools tox
122 python3 -m pip install python-snappy zstandard
123
124 - name: Cache Local Maven Repository
125 uses: actions/cache@v4
126 with:
127 path: ~/.m2/repository
128 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
129 restore-keys: |
130 ${{ runner.os }}-maven-
131
132 - name: 'Setup Temurin JDK 8, 11, 17 & 21'
133 uses: actions/setup-java@v5
134 with:
135 distribution: 'temurin'
136 java-version: |
137 8
138 11
139 17
140 21
141
142 - name: 'Setup Maven 3.9.6'
143 uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
144 with:
145 maven-version: 3.9.6
146
147 - name: Install Java Avro for Interop Test
148 working-directory: .
149 run: mvn -B install -PskipQuality
150
151 - name: Create Interop Data Directory
152 working-directory: .
153 run: mkdir -p build/interop/data
154
155 - name: Generate Interop Resources
156 working-directory: lang/java/avro
157 run: mvn -B -P interop-data-generate generate-resources
158
159 - name: Generate Interop Data
160 run: ./build.sh interop-data-generate
161
162 - name: Run Interop Tests
163 run: ./build.sh interop-data-test