|
| 1 | +--- |
| 2 | +name: CI |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + |
| 7 | +jobs: |
| 8 | + test_go: |
| 9 | + name: Go tests |
| 10 | + runs-on: ubuntu-latest |
| 11 | + container: |
| 12 | + # Whenever the Go version is updated here, .promu.yml |
| 13 | + # should also be updated. |
| 14 | + image: quay.io/prometheus/golang-builder:1.25-base |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 17 | + - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 |
| 18 | + - uses: ./.github/promci/actions/setup_environment |
| 19 | + - run: make test |
| 20 | + - run: make GO_ONLY=1 SKIP_GOLANGCI_LINT=1 |
| 21 | + integration_tests: |
| 22 | + name: Integration tests |
| 23 | + runs-on: ubuntu-latest |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + # Define Postgres versions to test against. |
| 27 | + postgres_version: [13.22] |
| 28 | + # postgres_version: [13.22, 14.19, 15.14, 16.10, 17.6] |
| 29 | + services: |
| 30 | + postgres: |
| 31 | + image: postgres:${{ matrix.postgres_version }} |
| 32 | + env: |
| 33 | + POSTGRES_DB: circle_test |
| 34 | + POSTGRES_USER: postgres |
| 35 | + POSTGRES_PASSWORD: test |
| 36 | + ports: |
| 37 | + - 5432:5432 |
| 38 | + # options: >- |
| 39 | + # --health-cmd="pg_isready -U postgres -d circle_test" |
| 40 | + # --health-interval=10s |
| 41 | + # --health-timeout=5s |
| 42 | + # --health-retries=5 |
| 43 | + container: |
| 44 | + # Whenever the Go version is updated here, .promu.yml |
| 45 | + # should also be updated. |
| 46 | + image: quay.io/prometheus/golang-builder:1.25-base |
| 47 | + env: |
| 48 | + DATA_SOURCE_NAME: 'postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable' |
| 49 | + GOOPTS: '-v -tags integration' |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 52 | + - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 |
| 53 | + - uses: ./.github/promci/actions/setup_environment |
| 54 | + - run: make build |
| 55 | + - run: make test |
0 commit comments