| 1 | name: Static analysis |
| 2 | on: |
| 3 | - push |
| 4 | - pull_request |
| 5 | |
| 6 | jobs: |
| 7 | test: |
| 8 | runs-on: ubuntu-latest |
| 9 | steps: |
| 10 | - name: Install Go |
| 11 | uses: actions/setup-go@v4 |
| 12 | with: |
| 13 | go-version: stable |
| 14 | |
| 15 | - name: Checkout code |
| 16 | uses: actions/checkout@v2 |
| 17 | |
| 18 | - name: Validate Go modules |
| 19 | run: | |
| 20 | make update-gomod |
| 21 | git diff --exit-code |
| 22 | |
| 23 | - name: Install dependencies |
| 24 | run: | |
| 25 | sudo add-apt-repository ppa:ubuntu-lxc/daily -y |
| 26 | sudo apt-get install -qq lxc-dev pkg-config libdbus-1-dev libseccomp-dev libcap-dev |
| 27 | go install golang.org/x/lint/golint@latest |
| 28 | go install golang.org/x/tools/cmd/goimports@latest |
| 29 | |
| 30 | - name: Static analysis |
| 31 | run: make all |