69 lines
2.4 KiB
YAML
69 lines
2.4 KiB
YAML
name: Verify Lyra CLI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ces-control
|
|
timeout-minutes: 60
|
|
env:
|
|
DOCKER_BUILDKIT: "0"
|
|
steps:
|
|
- name: Checkout with codex-bot
|
|
env:
|
|
CODEX_BOT_SSH_KEY: ${{ secrets.CODEX_BOT_SSH_KEY }}
|
|
GITEA_SSH_KNOWN_HOSTS: ${{ secrets.GITEA_SSH_KNOWN_HOSTS }}
|
|
SOURCE_SHA: ${{ gitea.sha }}
|
|
SOURCE_REPOSITORY: ${{ gitea.repository }}
|
|
run: |
|
|
set -eu
|
|
test -n "$CODEX_BOT_SSH_KEY"
|
|
test -n "$GITEA_SSH_KNOWN_HOSTS"
|
|
case "$SOURCE_SHA" in *[!0-9a-f]*|'') exit 1;; esac
|
|
test "${#SOURCE_SHA}" -eq 40
|
|
umask 077
|
|
checkout_keys=$(mktemp -d)
|
|
trap 'rm -rf "$checkout_keys"' EXIT
|
|
printf '%s\n' "$CODEX_BOT_SSH_KEY" > "$checkout_keys/key"
|
|
printf '%s\n' "$GITEA_SSH_KNOWN_HOSTS" > "$checkout_keys/known_hosts"
|
|
unset CODEX_BOT_SSH_KEY GITEA_SSH_KNOWN_HOSTS
|
|
export GIT_SSH_COMMAND="ssh -F /dev/null -o IdentitiesOnly=yes -i $checkout_keys/key -p 22222 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$checkout_keys/known_hosts"
|
|
git init .
|
|
source_url="ssh://git@gitea.entroia.com:22222/$SOURCE_REPOSITORY.git"
|
|
if git remote get-url origin >/dev/null 2>&1; then
|
|
git remote set-url origin "$source_url"
|
|
else
|
|
git remote add origin "$source_url"
|
|
fi
|
|
git fetch --no-tags --depth=1 origin "$SOURCE_SHA"
|
|
git checkout --detach --force FETCH_HEAD
|
|
git submodule update --init --recursive
|
|
- name: Verify CLI and record Endor output
|
|
env:
|
|
LYRA_RELEASE_SHA: ${{ gitea.sha }}
|
|
run: sh scripts/ci-ces-control.sh
|
|
- name: Show Endor output
|
|
if: always()
|
|
run: cat ci-output/endor-examples.md
|
|
- name: Upload Endor output
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: endor-execution-output-${{ gitea.sha }}
|
|
path: |
|
|
ci-output/endor-examples.md
|
|
ci-output/endor-examples.json
|
|
if-no-files-found: error
|
|
retention-days: 30
|
|
- name: Upload Linux CLI
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: lyra-linux-${{ gitea.sha }}
|
|
path: ci-output/lyra
|
|
if-no-files-found: error
|
|
retention-days: 30
|