Fix gqlgen (#1105)

This commit is contained in:
Googol Lee
2024-11-02 17:05:29 +01:00
committed by GitHub
parent 84c642ca79
commit 7b69f247d3
39 changed files with 3589 additions and 3497 deletions

View File

@@ -1,20 +1,22 @@
name: Docker builds
on:
pull_request:
branches: [master]
push:
branches: [master]
branches: ['*']
tags:
- v*
pull_request:
branches: [master]
schedule:
# At 01:18 every Thursday. Details in https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
- cron: '18 1 * * 4'
env:
IS_PUSHING_IMAGES: ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }}
# IS_PUSHING_IMAGES: true # Switch on when pushing images with forked repos.
DOCKER_REGISTRY: ${{ (github.repository == 'photoview/photoview' && '') || 'ghcr.io/' }}
DOCKER_USERNAME: viktorstrate
DOCKER_IMAGE: viktorstrate/photoview
DOCKER_IMAGE: ${{ (github.repository == 'photoview/photoview' && 'viktorstrate/photoview') || github.repository }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
@@ -82,7 +84,6 @@ jobs:
with:
platforms: ${{ env.PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -90,15 +91,16 @@ jobs:
if: ${{ env.IS_PUSHING_IMAGES == 'true' }}
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
registry: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && 'ghcr.io' }}
username: ${{ ( env.DOCKER_REGISTRY == 'ghcr.io/' && github.actor ) || env.DOCKER_USERNAME }}
password: ${{ ( env.DOCKER_REGISTRY == 'ghcr.io/' && github.token ) || env.DOCKER_PASSWORD }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: ${{ env.DOCKER_IMAGE }}
images: ${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}
# Docker tags based on the following events/attributes
tags: |
type=schedule
@@ -152,13 +154,13 @@ jobs:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Run Dockle for '${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}'
- name: Run Dockle for '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}'
id: dockle
if: ${{ matrix.tags.tag != '' }}
continue-on-error: true
uses: erzz/dockle-action@v1
with:
image: '${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}'
image: '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}'
report-name: dockle-results-${{ matrix.tags.tag }}
report-format: sarif
failure-threshold: fatal

View File

@@ -2,7 +2,7 @@ name: Tests
on:
push:
branches: [master]
branches: ['*']
pull_request:
branches: [master]
@@ -69,12 +69,13 @@ jobs:
continue-on-error: true
run: |
docker run --name test --network host \
-v "${{ github.workspace }}:/app" \
-e PHOTOVIEW_DATABASE_DRIVER=${{ matrix.database }} \
-e PHOTOVIEW_MYSQL_URL='photoview:photosecret@tcp(localhost:3306)/photoview_test' \
-e PHOTOVIEW_POSTGRES_URL='postgres://photoview:photosecret@localhost:5432/photoview_test' \
-e PHOTOVIEW_SQLITE_PATH=/tmp/photoview.db \
photoview/api \
go test ./... -v -database -filesystem -p 1 -coverprofile=coverage.txt -covermode=atomic
/app/scripts/test_all.sh
docker cp test:/app/api/coverage.txt ./api/
- name: Upload coverage