1name: Test after code changes
2on:
3  workflow_dispatch:
4  push:
5    paths:
6      - '**.c'
7      - '**.h'
8      - '**.py'
9      - '**.sh'
10      - '**.yml'
11      - '**.proto'
12      - '**.mk'
13      - '**.cmake'
14  pull_request:
15    paths:
16      - '**.c'
17      - '**.h'
18      - '**.py'
19      - '**.sh'
20      - '**.yml'
21      - '**.proto'
22      - '**.mk'
23      - '**.cmake'
24
25jobs:
26  smoke_test:
27    name: Run test suite on Ubuntu 20.04
28    runs-on: ${{ matrix.os }}
29    strategy:
30      matrix:
31        python-version: ['3.8', '3.x']
32        os: ['ubuntu-20.04', 'ubuntu-24.04']
33
34    steps:
35      - name: Check out code from GitHub
36        uses: actions/checkout@v4
37        with:
38          path: nanopb
39
40      - name: Setup Python
41        uses: actions/setup-python@v5
42        with:
43          python-version: ${{ matrix.python-version }}
44
45      - name: Install dependencies
46        run: |
47          sudo apt-get update
48          sudo apt-get install protobuf-compiler splint valgrind
49          python3 -m pip install --user --upgrade scons protobuf grpcio-tools pyinstaller
50          python3 -c 'import google.protobuf; print(google.protobuf.__file__)'
51
52      - name: Run tests
53        run: |
54          cd nanopb/tests
55          scons
56
57  fuzz_tests:
58    needs: smoke_test
59    uses: ./.github/workflows/cifuzz.yml
60
61  binary_builds:
62    needs: smoke_test
63    uses: ./.github/workflows/binary_packages.yml
64
65