Skip to content

Merge branch 'RA-8279_improve_application_visibility_timing_logs' int… #37

Merge branch 'RA-8279_improve_application_visibility_timing_logs' int…

Merge branch 'RA-8279_improve_application_visibility_timing_logs' int… #37

Workflow file for this run

---
name: Test CRDB
on:
push:
branches:
- master
- RA-8661_apply_updates_from_google
pull_request:
branches:
- master
- RA-8661_apply_updates_from_google
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CT_APP_ID }}
private-key: ${{ secrets.CT_APP_PRIVATE_KEY }}
owner: digicert
repositories: ctutils
- name: Authenticate with private ctutils
run: |
git config --global url."https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/".insteadOf "https://github.com/"
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: 'v2.6.0'
args: ./storage/crdb
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CT_APP_ID }}
private-key: ${{ secrets.CT_APP_PRIVATE_KEY }}
owner: digicert
repositories: ctutils
- name: Authenticate with private ctutils
run: |
git config --global url."https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/".insteadOf "https://github.com/"
- name: Run tests
run: go test -v ./storage/crdb/... ./quota/crdbqm/...
integration:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CT_APP_ID }}
private-key: ${{ secrets.CT_APP_PRIVATE_KEY }}
owner: digicert
repositories: ctutils
- name: Authenticate with private ctutils
run: |
git config --global url."https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/".insteadOf "https://github.com/"
- name: Build before tests
run: go mod download && go build ./...
- name: Run CockroachDB
run: docker run --rm -d --name=roach -p 8080:8080 -p 26257:26257 -v "${PWD}/cockroach-data:/cockroach/cockroach-data" cockroachdb/cockroach:latest start-single-node --insecure
- name: Wait for CockroachDB
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_seconds: 15
max_attempts: 3
retry_on: error
command: docker exec roach ./cockroach sql --insecure -e "SELECT 1"
- name: Get crdb logs
run: docker logs roach
- name: Run tests
run: ./integration/integration_test.sh
env:
TEST_COCKROACHDB_URI: postgresql://root@localhost:26257/defaultdb?sslmode=disable
CRDB_IN_CONTAINER: true
CRDB_CONTAINER_NAME: roach