More updates to linting and remove REST service #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linting & Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| go-version: ['1.24', '1.25'] | |
| os: [ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Start headless Chrome | |
| run: | | |
| docker run -d \ | |
| --name chromedp \ | |
| -p 9222:9222 \ | |
| chromedp/headless-shell:latest \ | |
| /headless-shell/headless-shell \ | |
| --no-sandbox \ | |
| --disable-gpu \ | |
| --disable-dev-shm-usage \ | |
| --remote-debugging-address=0.0.0.0 \ | |
| --remote-debugging-port=9222 | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Disable AppArmor unprivileged userns restriction | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| if: runner.os == 'Linux' | |
| - name: Set up tools | |
| env: | |
| CHROMEDP_REMOTE_URL: "http://localhost:9222" | |
| run: | | |
| go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | |
| - name: Run go fmt check | |
| run: | | |
| if [ -n "$(gofmt -l .)" ]; then | |
| echo "Go files are not formatted. Run 'gofmt -w .' to fix them." | |
| exit 1 | |
| fi | |
| - name: Run linting | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.6 | |
| - name: Run tests | |
| run: go test ./... |