Skip to content

[+] bump actions/upload-artifact from 4 to 5 (#723) #1011

[+] bump actions/upload-artifact from 4 to 5 (#723)

[+] bump actions/upload-artifact from 4 to 5 (#723) #1011

Workflow file for this run

name: Build and Test
permissions:
contents: write
packages: write
pages: write
on:
push:
branches:
- master
pull_request:
paths-ignore: ['docs/**', 'mkdocs.yml']
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# This workflow uses testcontainers-go for PostgreSQL testing
# Docker provides consistent environment - only Ubuntu needed
jobs:
test:
if: true # false to skip job during debug
name: Test and Build with Testcontainers
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Set up Golang
uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: Get dependencies
run: |
go mod download
go version
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
- name: Test with Testcontainers
run: go test -failfast -v -timeout=300s -coverprofile=profile.cov ./...
- name: Upload coverage profile
uses: actions/upload-artifact@v5
with:
name: coverage-profile-${{ github.run_id }}
path: profile.cov
retention-days: 1
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --snapshot --skip=publish --clean
coverage:
if: true # false to skip job during debug
name: Coverage Report
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Download coverage profile
uses: actions/download-artifact@v6
with:
name: coverage-profile-${{ github.run_id }}
- name: Send coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
file: profile.cov
build-docs:
if: true # false to skip job during debug
needs: [test]
name: Build Docs
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Set up Golang
uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: Set up gopages
run: go install github.com/johnstarich/go/[email protected]
- name: Build Developer Docs
run: gopages -out "docs/godoc" -base "/pg_timetable/devel/godoc" -internal
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
cache: 'pip'
cache-dependency-path: '**/requirements-doc.txt'
- name: Install dependencies
run: pip install -r docs/requirements-doc.txt
- name: Check if we should push to gh-pages
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
git fetch origin gh-pages --depth=1
echo "push_opt=--push" >> $GITHUB_ENV
- name: Build mkdocs
run: mike deploy ${{ env.push_opt }} devel
test-docker-images:
if: true # false to skip job during debug
needs: [test]
name: Test Docker Image Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Prepare build metadata
id: meta
run: |
echo "GIT_HASH=${{ github.sha }}" >> $GITHUB_OUTPUT
echo "GIT_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT
- name: Test build Docker image (fast, amd64 only)
uses: ./.github/actions/build-docker
with:
dockerfile: Dockerfile
image-name: cybertecpostgresql/pg_timetable
platforms: linux/amd64
push: 'false'
cache-scope: test-build
build-args: |
COMMIT=${{ steps.meta.outputs.GIT_HASH }}
DATE=${{ steps.meta.outputs.GIT_TIME }}
VERSION=${{ steps.meta.outputs.VERSION }}