| name: Test |
| |
| on: |
| push: |
| branches: [ master ] |
| pull_request: |
| branches: [ master ] |
| |
| jobs: |
| |
| lint: |
| runs-on: ubuntu-20.04 |
| steps: |
| - uses: actions/checkout@v3 |
| - uses: actions/setup-go@v2 |
| with: |
| go-version: 1.x # Latest stable version. |
| - uses: golangci/golangci-lint-action@v3 |
| with: |
| version: v1.44 |
| |
| test: |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| go-version: [1.16.x, 1.17.x, 1.18.0-beta1] |
| race: ["-race", ""] |
| |
| steps: |
| |
| - name: Set up Go |
| uses: actions/setup-go@v2 |
| with: |
| stable: '!contains(${{ matrix.go-version }}, "beta") && !contains(${{ matrix.go-version }}, "rc")' |
| go-version: ${{ matrix.go-version }} |
| |
| - name: Checkout |
| uses: actions/checkout@v3 |
| |
| - name: Install dbus |
| run: sudo apt-get update && sudo apt-get install dbus dbus-x11 |
| |
| - name: Build |
| run: go build ${{ matrix.race }} -v ./... |
| |
| - name: Test |
| run: go test ${{ matrix.race }} -v ./... |
| |
| codespell: |
| runs-on: ubuntu-20.04 |
| steps: |
| - uses: actions/checkout@v3 |
| - name: install deps |
| # Version of codespell bundled with Ubuntu is way old, so use pip. |
| run: pip install codespell |
| - name: run codespell |
| run: codespell -S .git |