linux.yml 971 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: linux
  2. on: [push, pull_request]
  3. jobs:
  4. test:
  5. strategy:
  6. matrix:
  7. image: ['debian:latest', 'ubuntu:latest']
  8. name: Test with ${{ matrix.image }}
  9. runs-on: ubuntu-latest
  10. container:
  11. image: ${{ matrix.image }}
  12. env:
  13. DISPLAY: ':99.0'
  14. defaults:
  15. run:
  16. shell: bash
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@v2
  20. - name: Setup Go
  21. uses: actions/setup-go@v2
  22. with:
  23. go-version: '1.17.x'
  24. - name: Install dependencies
  25. if: ${{ matrix.image == 'debian:latest' || matrix.image == 'ubuntu:latest' }}
  26. run: |
  27. apt-get update
  28. apt-get install -y libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev pkg-config
  29. - name: Xvfb
  30. run: |
  31. Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
  32. - name: go test
  33. run: |
  34. go test -tags=example -v ./...