1name: Run tests on Python 2 2 3on: 4 workflow_dispatch: 5 workflow_call: 6 push: 7 paths: 8 - '**.py' 9 pull_request: 10 paths: 11 - '**.py' 12 13jobs: 14 test_python2: 15 name: Test with Python 2 on Ubuntu 18.04 16 runs-on: ubuntu-18.04 17 18 steps: 19 - name: Check out code from GitHub 20 uses: actions/checkout@v2 21 with: 22 path: nanopb 23 fetch-depth: "0" 24 25 - name: Install dependencies 26 run: | 27 sudo apt-get update 28 sudo apt-get install python-protobuf protobuf-compiler scons 29 30 - name: Run tests with Python 2 31 run: | 32 cd nanopb 33 export GENPATH=$(bash -c 'printf %q "$(pwd)/generator/protoc-gen-nanopb-py2"') 34 cd tests 35 scons PYTHON="/usr/bin/python2" PROTOC="/usr/bin/protoc" PROTOCFLAGS="--plugin=protoc-gen-nanopb=$GENPATH" 36 37