Skip to content

repository_dispatch #28

repository_dispatch

repository_dispatch #28

name: Trigger from Power Automate
on:
- repository_dispatch
- workflow_dispatch
jobs:
high_level_tests:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
FINGERPRINT: ${{ github.event.client_payload.fingerprint }}
PG_VERSION: ${{ github.event.client_payload.postgresql_version }}
AGE_VERSION: ${{ github.event.client_payload.apache_age_version }}
RC_VERSION: ${{ github.event.client_payload.rc_version }}
COMMIT_HASH: ${{ github.event.client_payload.git_commit_hash }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: age_rel_verifier:latest
load: true
- name: Run tests in Docker container
run: |
docker run \
-e OPENAI_API_KEY="$OPENAI_API_KEY" \
-e FINGERPRINT="$FINGERPRINT" \
-e PG_VERSION="$PG_VERSION" \
-e AGE_VERSION="$AGE_VERSION" \
-e RC_VERSION="$RC_VERSION" \
-e COMMIT_HASH="$COMMIT_HASH" \
age_rel_verifier:latest
smoketest_age:
runs-on: ubuntu-latest
env:
PG_VERSION: ${{ github.event.client_payload.postgresql_version }}
AGE_VERSION: ${{ github.event.client_payload.apache_age_version }}
RC_VERSION: ${{ github.event.client_payload.rc_version }}
COMMIT_HASH: ${{ github.event.client_payload.git_commit_hash }}
steps:
- name: Checkout other repository
uses: actions/checkout@v2
with:
repository: apache/age
ref: ${{ env.COMMIT_HASH }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Create validation script to run in Docker
run: |
curl https://gist.githubusercontent.com/sorrell/e45cb8e448af14237a20dcee9b8864ec/raw/e9a7e1c08c6b42538045dc0dfc7477671e158544/validate_docker.sh > validate.sh
chmod +x validate.sh
- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: testage:${{ env.AGE_VERSION }}
load: true
- name: Run tests in Docker container
run: docker run -v $(pwd):/app -w /app --entrypoint /app/validate.sh --rm --name testage -e POSTGRES_PASSWORD=pass testage:${{ env.AGE_VERSION }}