Debian Codegraph @

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