|
| 1 | +name: test |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + test-matrix: |
| 7 | + |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + operating-system: [ubuntu-18.04, windows-2019] |
| 11 | + |
| 12 | + runs-on: ${{ matrix.operating-system }} |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Disable EOL conversions |
| 16 | + run: git config --global core.autocrlf false |
| 17 | + |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@master |
| 20 | + |
| 21 | + - name: Install Go |
| 22 | + uses: actions/setup-go@v1 |
| 23 | + with: |
| 24 | + go-version: '1.12.x' |
| 25 | + |
| 26 | + - name: Install Go deps |
| 27 | + run: | |
| 28 | + go get github.com/golangci/govet |
| 29 | + go get golang.org/x/lint/golint |
| 30 | + go get github.com/golang/protobuf/protoc-gen-go |
| 31 | +
|
| 32 | + - name: Install Taskfile |
| 33 | + uses: Arduino/actions/setup-taskfile@master |
| 34 | + |
| 35 | + - name: Check the code is good |
| 36 | + run: task check |
| 37 | + |
| 38 | + - name: Install protoc compiler |
| 39 | + uses: Arduino/actions/setup-protoc@master |
| 40 | + |
| 41 | + - name: Check protocol buffers compile correctly |
| 42 | + run: task protoc |
| 43 | + |
| 44 | + - name: Build the CLI |
| 45 | + run: task build |
| 46 | + |
| 47 | + - name: Run unit tests |
| 48 | + run: task test-unit |
| 49 | + |
| 50 | + - name: Run unit tests on the legacy package |
| 51 | + if: matrix.operating-system != 'windows-2019' |
| 52 | + run: task test-legacy |
| 53 | + |
| 54 | + - name: Install Python |
| 55 | + uses: actions/setup-python@v1 |
| 56 | + with: |
| 57 | + python-version: '3.x' |
| 58 | + architecture: 'x64' |
| 59 | + |
| 60 | + - name: Run integration tests |
| 61 | + run: | |
| 62 | + pip install -r test/requirements.txt |
| 63 | + task test-integration |
| 64 | +
|
| 65 | + - name: Send unit tests coverage to Codecov |
| 66 | + if: matrix.operating-system != 'windows-2019' |
| 67 | + uses: codecov/codecov-action@v1.0.2 |
| 68 | + with: |
| 69 | + token: ${{secrets.CODECOV_TOKEN}} |
| 70 | + file: ./coverage_unit.txt |
| 71 | + flags: unit |
| 72 | + |
| 73 | + - name: Send integration tests coverage to Codecov |
| 74 | + if: matrix.operating-system != 'windows-2019' |
| 75 | + uses: codecov/codecov-action@v1.0.2 |
| 76 | + with: |
| 77 | + token: ${{secrets.CODECOV_TOKEN}} |
| 78 | + file: ./coverage_integ.txt |
| 79 | + flags: integ |
0 commit comments