mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-03-15 11:12:02 +00:00
83 lines
2.4 KiB
YAML
83 lines
2.4 KiB
YAML
name: Proxy Integration Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
build:
|
|
type: boolean
|
|
description: Build from current tag before running tests
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
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
|