Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
muety committed Dec 16, 2023
2 parents b23d514 + c292b79 commit 231f708
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 23 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
permissions:
contents: read
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ^1.21
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get dependencies
run: go get

Expand All @@ -42,13 +42,13 @@ jobs:
db: [sqlite, postgres, mysql, mariadb]

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ^1.21
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- run: ./testing/run_api_tests.sh ${{ matrix.db }} --migration
16 changes: 7 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set version
run: |
Expand All @@ -20,27 +20,27 @@ jobs:
|| git rev-parse --short HEAD) > version.txt 2> /dev/null
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
Expand All @@ -53,12 +53,10 @@ jobs:
type=semver,pattern={{version}}
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=n1try/wakapi:buildcache-alpine
cache-to: type=registry,ref=n1try/wakapi:buildcache-alpine,mode=max
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ jobs:
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ^1.21
cache: false
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set version
shell: bash
Expand Down
11 changes: 7 additions & 4 deletions routes/api/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@ func (h *MetricsHandler) getUserMetrics(user *models.User) (*mm.Metrics, error)
return nil, err
}

leaderboard, err := h.leaderboardSrvc.GetByIntervalAndUser(h.leaderboardSrvc.GetDefaultScope(), user.ID, false)
if err != nil {
conf.Log().Error("failed to fetch leaderboard for user '%s' for metric", user.ID)
return nil, err
var leaderboard models.Leaderboard
if h.config.App.LeaderboardEnabled {
leaderboard, err = h.leaderboardSrvc.GetByIntervalAndUser(h.leaderboardSrvc.GetDefaultScope(), user.ID, false)
if err != nil {
conf.Log().Error("failed to fetch leaderboard for user '%s' for metric", user.ID)
return nil, err
}
}

// User Metrics
Expand Down
67 changes: 67 additions & 0 deletions static/assets/images/logo-marketing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 231f708

Please sign in to comment.