feat: add workflow for ci

This commit is contained in:
Stavros
2026-03-14 20:24:37 +02:00
parent bd57c480f3
commit a3d310667b
5 changed files with 115 additions and 7 deletions

79
.github/workflows/integration.yml vendored Normal file
View File

@@ -0,0 +1,79 @@
name: Proxy Integration Tests
on:
workflow_dispatch:
inputs:
build:
type: boolean
description: Build from current tag before running tests
jobs:
determine-tag:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.metadata.outputs.VERSION }}
commit_hash: ${{ steps.metadata.outputs.COMMIT_HASH }}
build_timestamp: ${{ steps.metadata.outputs.BUILD_TIMESTAMP }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Determine metadata
id: metadata
run: |
# Generate static metadata
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%dT%H:%M:%S')" >> "$GITHUB_OUTPUT"
# Determine version
if [ "${{ inputs.build }}" == "true" ]; then
echo "VERSION=development" >> "$GITHUB_OUTPUT"
else
echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
integration:
runs-on: ubuntu-latest
needs: determine-tag
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.25.0"
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: ${{ inputs.build == 'true' }}
- name: Build
uses: docker/build-push-action@v6
if: ${{ inputs.build == 'true' }}
with:
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/tinyauth:${{ needs.determine-tag.outputs.version }}
outputs: type=image,push=false
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ needs.determine-tag.outputs.version }}
COMMIT_HASH=${{ needs.determine-tag.outputs.commit_hash }}
BUILD_TIMESTAMP=${{ needs.determine-tag.outputs.build_timestamp }}
- name: Set tinyauth version
run: |
sed -i "s/TINYAUTH_VERSION=.*/TINYAUTH_VERSION=${{ needs.determine-tag.outputs.version }}/" integration/.env
- name: Test
run: make integration