name: CI

on:
  pull_request:
  push:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Run golangci-lint
      uses: golangci/golangci-lint-action@v2.5.1
      with:
        version: v1.38
    - name: Run tests and attempt building
      run: |
        export PATH=$(go env GOPATH)/bin:$PATH
        go test -mod vendor -v -race ./...
        go build -mod vendor
  docker-build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Build the Docker image
      run: docker build . --file Dockerfile --tag iptv-proxy:ci-build
