diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..adc3e5e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: continuous integration + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + go-version: [1.21, 1.22] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ matrix.go-version }}- + + - name: Install dependencies + run: go mod download + + - name: Check Go fmt + run: | + if ! go fmt ./...; then + echo "Go fmt check failed" + exit 1 + fi + + - name: Run Go vet + run: go vet ./... + + - name: Run tests + run: go test ./... -v -cover diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml deleted file mode 100644 index 1ae88c3..0000000 --- a/.github/workflows/go-check.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Go Checks - -on: - pull_request: - push: - branches: ["main"] - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} - cancel-in-progress: true - -jobs: - go-check: - uses: ipdxco/unified-github-workflows/.github/workflows/go-check.yml@v1.0 \ No newline at end of file diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml deleted file mode 100644 index 435155b..0000000 --- a/.github/workflows/go-test.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Go Test - -on: - pull_request: - push: - branches: ["main"] - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} - cancel-in-progress: true - -jobs: - go-test: - uses: ipdxco/unified-github-workflows/.github/workflows/go-test.yml@v1.0 - with: - go-versions: '["this"]' diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml deleted file mode 100644 index d5e18aa..0000000 --- a/.github/workflows/release-check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Release Checker - -on: - pull_request_target: - paths: [ 'version.json' ] - types: [ opened, synchronize, reopened, labeled, unlabeled ] - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - release-check: - uses: ipdxco/unified-github-workflows/.github/workflows/release-check.yml@v1.0 \ No newline at end of file diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml deleted file mode 100644 index d8221e4..0000000 --- a/.github/workflows/releaser.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Releaser - -on: - push: - paths: [ 'version.json' ] - workflow_dispatch: - -permissions: - contents: write - -concurrency: - group: ${{ github.workflow }}-${{ github.sha }} - cancel-in-progress: true - -jobs: - releaser: - uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1.0 \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 16d65d7..0000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Close and mark stale issue - -on: - schedule: - - cron: '0 0 * * *' - -permissions: - issues: write - pull-requests: write - -jobs: - stale: - uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3 diff --git a/.github/workflows/tagpush.yml b/.github/workflows/tagpush.yml deleted file mode 100644 index ed8c8e8..0000000 --- a/.github/workflows/tagpush.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Tag Push Checker - -on: - push: - tags: - - v* - -permissions: - contents: read - issues: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - releaser: - uses: ipdxco/unified-github-workflows/.github/workflows/tagpush.yml@v1.0 \ No newline at end of file diff --git a/queen.go b/queen.go index 6a4bb0b..c6f1444 100644 --- a/queen.go +++ b/queen.go @@ -73,7 +73,7 @@ func NewQueen(ctx context.Context, dbConnString string, keysDbPath string, nPort dbPort, err := strconv.Atoi(os.Getenv("DB_PORT")) if err != nil { - fmt.Errorf("Port must be an integer", err) + logger.Errorf("Port must be an integer", err) } mP, _ := tele.NewMeterProvider()