name: CI Test on: [push, pull_request] jobs: lint: runs-on: ubuntu-latest steps: - name: Setup go uses: actions/setup-go@v2 with: go-version: '^1.14' - name: Checkout repository uses: actions/checkout@v2 - name: Setup golangci-lint run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0 - name: Run golangci-lint run: golangci-lint run ./... - name: Verify Codegen run: ./hack/verify-deepcopy-gen.sh test: strategy: matrix: kong_version: [ '1.0.3', '1.1.2', '1.2.0', '1.3.0', '1.4.0', '2.0.4', '2.1.0'] env: KONG_VERSION: ${{ matrix.kong_version }} KONG_ENTERPRISE_REPO_USERNAME: ${{ secrets.KONG_ENTERPRISE_REPO_USERNAME }} KONG_ENTERPRISE_REPO_PASSSWORD: ${{ secrets.KONG_ENTERPRISE_REPO_PASSSWORD }} KONG_LICENSE_DATA: ${{ secrets.KONG_LICENSE_DATA }} KONG_ANONYMOUS_REPORTS: "off" runs-on: ubuntu-latest services: postgres: image: postgres:11.6-alpine ports: - 5432:5432 # needed because the postgres container does not provide a healthcheck options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - name: Setup go uses: actions/setup-go@v2 with: go-version: '^1.14' - name: Checkout repository uses: actions/checkout@v2 - name: Setup Postgres run: | psql -c 'create database kong;' -U postgres -h 127.0.0.1 -p 5432 psql -c 'create user kong;' -U postgres -h 127.0.0.1 -p 5432 psql -c 'GRANT ALL PRIVILEGES ON DATABASE "kong" to kong;' -U postgres -h 127.0.0.1 -p 5432 - name: Setup Kong run: bash .ci/setup_kong.sh - name: Run tests run: go test -v ./... test-enterprise: strategy: matrix: kong_version: ['enterprise-1.3.0.2', 'enterprise-1.5.0.2'] env: KONG_VERSION: ${{ matrix.kong_version }} KONG_ENTERPRISE_REPO_USERNAME: ${{ secrets.KONG_ENTERPRISE_REPO_USERNAME }} KONG_ENTERPRISE_REPO_PASSSWORD: ${{ secrets.KONG_ENTERPRISE_REPO_PASSSWORD }} KONG_LICENSE_DATA: ${{ secrets.KONG_LICENSE_DATA }} KONG_ANONYMOUS_REPORTS: "off" KONG_ADMIN_TOKEN: kong runs-on: ubuntu-latest services: postgres: image: postgres:11.6-alpine ports: - 5432:5432 # needed because the postgres container does not provide a healthcheck options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - name: Setup go uses: actions/setup-go@v2 with: go-version: '^1.14' - name: Checkout repository uses: actions/checkout@v2 - name: Setup Postgres run: | psql -c 'create database kong;' -U postgres -h 127.0.0.1 -p 5432 psql -c 'create user kong;' -U postgres -h 127.0.0.1 -p 5432 psql -c 'GRANT ALL PRIVILEGES ON DATABASE "kong" to kong;' -U postgres -h 127.0.0.1 -p 5432 - name: Setup Kong run: bash .ci/setup_kong.sh - name: Run tests run: go test -tags=enterprise -v ./...