From 02b31ea64def8a20ab87c4dfc0aa473a3975c66a Mon Sep 17 00:00:00 2001 From: Derek Horton Date: Thu, 5 Sep 2024 13:05:40 -0500 Subject: [PATCH] Ignore the github workflow changes for now --- .github/workflows/golangci-lint.yml | 6 +-- .github/workflows/pr.yml | 73 +++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 64ed0621..d2455795 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,12 +16,12 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v3 with: go-version: 1.18 - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: latest diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..5033fc18 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,73 @@ + +--- +name: Validation + +on: +- pull_request + +jobs: + lint: + runs-on: ubuntu-latest + container: node:12-slim + + steps: + - uses: actions/checkout@v2 + - run: npx @stoplight/spectral@6.0.0 lint schema/public.openapi.yaml + - run: npx @stoplight/spectral@6.0.0 lint schema/private.openapi.yaml + + golang: + runs-on: ubuntu-20.04 + services: + postgres: + image: postgres + env: + POSTGRES_DB: insights + POSTGRES_USER: insights + POSTGRES_PASSWORD: insights + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-go@v1 + with: + go-version: 1.18 + + - run: make build + - run: go vet . + + - run: CLOWDER_ENABLED=false make test + + - name: test down migrations + run: make migrate-db-undo-all + + # Check that the code generated from the OpenAPI schema is up-to-date (i.e. make generate-api has been run after changing the openapi schema) + - name: test openapi schema up to date + run: make init && cp internal/api/controllers/private/spec.gen.go internal/api/controllers/private/spec.gen.go.bak && make generate-api && diff internal/api/controllers/private/spec.gen.go internal/api/controllers/private/spec.gen.go.bak + env: + GOPATH: /home/runner/go + + java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Cache Maven dependencies + uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Build with Maven + run: mvn -f event-streams/pom.xml clean verify