Fix workflow path filters for repository root structure
Some checks failed
Run Tests / Run Go Tests (push) Successful in 4m21s
Run Tests / Lint Code (push) Failing after 54s

This commit is contained in:
2025-11-21 15:27:02 +03:00
parent 1d37f50604
commit 971c62afc5
2 changed files with 13 additions and 11 deletions

View File

@@ -62,7 +62,6 @@ jobs:
pack config default-builder paketobuildpacks/builder-jammy-tiny:latest pack config default-builder paketobuildpacks/builder-jammy-tiny:latest
- name: Prepare build environment - name: Prepare build environment
working-directory: backend
run: | run: |
# Create .env.production for build (no secrets, just structure) # Create .env.production for build (no secrets, just structure)
cat > .env.production << EOF cat > .env.production << EOF
@@ -77,15 +76,15 @@ jobs:
run: | run: |
PACK_ARGS=( PACK_ARGS=(
"${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${IMAGE_TAG}"
--path backend --path .
) )
if [ -n "$PACK_DOCKER_HOST" ]; then if [ -n "$PACK_DOCKER_HOST" ]; then
PACK_ARGS+=(--docker-host "$PACK_DOCKER_HOST") PACK_ARGS+=(--docker-host "$PACK_DOCKER_HOST")
fi fi
if [ -f "backend/.env.production" ]; then if [ -f ".env.production" ]; then
PACK_ARGS+=(--env-file backend/.env.production) PACK_ARGS+=(--env-file .env.production)
fi fi
pack build "${PACK_ARGS[@]}" pack build "${PACK_ARGS[@]}"

View File

@@ -7,14 +7,20 @@ on:
- production - production
- develop - develop
paths: paths:
- 'backend/**' - '**/*.go'
- 'go.mod'
- 'go.sum'
- '.gitea/workflows/test.yml'
pull_request: pull_request:
branches: branches:
- main - main
- production - production
- develop - develop
paths: paths:
- 'backend/**' - '**/*.go'
- 'go.mod'
- 'go.sum'
- '.gitea/workflows/test.yml'
jobs: jobs:
test: test:
@@ -34,23 +40,21 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ~/go/pkg/mod path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('backend/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: | restore-keys: |
${{ runner.os }}-go- ${{ runner.os }}-go-
- name: Install dependencies - name: Install dependencies
working-directory: backend
run: go mod download run: go mod download
- name: Run tests - name: Run tests
working-directory: backend
run: go test -v -race -coverprofile=coverage.out ./... run: go test -v -race -coverprofile=coverage.out ./...
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@v4
if: always() if: always()
with: with:
file: ./backend/coverage.out file: ./coverage.out
flags: backend flags: backend
name: backend-coverage name: backend-coverage
@@ -71,4 +75,3 @@ jobs:
uses: golangci/golangci-lint-action@v4 uses: golangci/golangci-lint-action@v4
with: with:
version: latest version: latest
working-directory: backend