Files
DiunDashboard/.gitea/workflows/ci.yml
Jean-Luc Makiola 6094edc5c8
Some checks failed
CI / build-test (push) Successful in 1m25s
CI / docker (push) Failing after 1s
- **refactor(main):** migrate static HTML to React components
- **feat(ui):** implement `AcknowledgeButton` component for acknowledging images
- **feat(stats):** add dashboard stats for total images, pending updates, and acknowledged status
- **chore(deps):** introduce `bun` dependency management and add required libraries
- **style(ui):** enhance UI with Tailwind-based components and modularity improvements
- **chore:** add drag-and-drop tag assignment using `@dnd-kit/core`
2026-02-25 20:37:15 +01:00

72 lines
2.3 KiB
YAML

name: CI
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build-test:
runs-on: docker
container:
image: gitea.jeanlucmakiola.de/makiolaj/docker-node-and-go:064281efa4401d6f440edd18dc467929b89d7f71
env:
GOTOOLCHAIN: local
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "Unformatted files:"
echo "$unformatted"
exit 1
fi
- name: Run go vet
run: go vet ./...
- name: Run tests with coverage
run: |
go test -v -coverprofile=coverage.out -coverpkg=./... ./...
go tool cover -func=coverage.out | tee coverage.txt
cov=$(go tool cover -func=coverage.out | grep total: | awk '{print substr($3, 1, length($3)-1)}')
cov=${cov%.*}
if [ "$cov" -lt 80 ]; then
echo "::warning::Test coverage is below 80% ($cov%)"
fi
- name: Build binary
run: go build ./...
docker:
runs-on: dind
needs: build-test
if: gitea.event_name == 'push'
env:
DOCKER_HOST: tcp://dind:2375
steps:
- name: Install dependencies
run: apk add --no-cache git
- name: Checkout
run: |
GITEA_HOST="${{ gitea.server_url }}"
GITEA_HOST="${GITEA_HOST#https://}"
GITEA_HOST="${GITEA_HOST#http://}"
git clone "https://oauth2:${{ secrets.GITEA_TOKEN }}@${GITEA_HOST}/${{ gitea.repository }}.git" .
git checkout ${{ gitea.sha }}
- name: Log in to Gitea registry
run: |
REGISTRY="${{ gitea.server_url }}"
REGISTRY="${REGISTRY#https://}"
REGISTRY="${REGISTRY#http://}"
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin
- name: Build and push
run: |
REGISTRY="${{ gitea.server_url }}"
REGISTRY="${REGISTRY#https://}"
REGISTRY="${REGISTRY#http://}"
IMAGE="$REGISTRY/$(echo '${{ gitea.repository }}' | tr '[:upper:]' '[:lower:]')"
docker buildx build -t "$IMAGE:${{ gitea.sha }}" -t "$IMAGE:latest" .
docker push "$IMAGE:${{ gitea.sha }}"
docker push "$IMAGE:latest"