| 1 | name: Go |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [ main ] |
| 6 | pull_request: |
| 7 | branches: [ main ] |
| 8 | |
| 9 | jobs: |
| 10 | |
| 11 | build: |
| 12 | runs-on: ubuntu-latest |
| 13 | steps: |
| 14 | - uses: actions/checkout@v2 |
| 15 | |
| 16 | - name: Set up Go |
| 17 | uses: actions/setup-go@v2 |
| 18 | with: |
| 19 | go-version: 1.16 |
| 20 | |
| 21 | - name: Install nftable headers |
| 22 | run: sudo apt-get install libnftables-dev |
| 23 | |
| 24 | - name: Format Check |
| 25 | run: ./automation/run-tests.sh --fmt |
| 26 | |
| 27 | - name: Build |
| 28 | run: ./automation/run-tests.sh --build |
| 29 | |
| 30 | - name: Run Unit Tests |
| 31 | run: ./automation/run-tests.sh --unit-test |
| 32 | |
| 33 | integration-tests: |
| 34 | runs-on: ubuntu-latest |
| 35 | steps: |
| 36 | - uses: actions/checkout@v2 |
| 37 | |
| 38 | - name: Start Docker Service |
| 39 | run: sudo service docker start |
| 40 | |
| 41 | - name: Run Integration Tests |
| 42 | run: ./automation/run-tests.sh --integration-test |