Skip to content

chore: update CI template #32

chore: update CI template

chore: update CI template #32

Workflow file for this run

name: "CI - Test Templates And Features"
on:
pull_request:
jobs:
smoke-test:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v6
- name: Smoke test for "gz"
id: smoke_test
uses: ./.github/actions/smoke-test
with:
template: "gz"
feature-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Validate feature metadata
run: bash features/test/test_all.sh
gen-docs:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.CI_BOT_TOKEN }}
- name: "Generate Template Docs"
uses: devcontainers/action@v1
with:
base-path-to-templates: "./templates/src"
generate-docs: "true"
- name: "Generate Feature Docs"
uses: devcontainers/action@v1
with:
base-path-to-features: "./features/src"
generate-docs: "true"
- uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: Update generated docs
complete:
needs:
- gen-docs
- feature-tests
- smoke-test
if: always()
runs-on: ubuntu-latest
steps:
- name: Verify required jobs succeeded
env:
SMOKE_TEST_RESULT: ${{ needs.smoke-test.result }}
FEATURE_TESTS_RESULT: ${{ needs.feature-tests.result }}
GEN_DOCS_RESULT: ${{ needs.gen-docs.result }}
run: |
set -euo pipefail
echo "smoke_test: ${SMOKE_TEST_RESULT}"
echo "feature_tests: ${FEATURE_TESTS_RESULT}"
echo "gen_docs: ${GEN_DOCS_RESULT}"
if [[ "${SMOKE_TEST_RESULT}" != "success" ]]; then
echo "Required job 'smoke_test' did not succeed."
exit 1
fi
if [[ "${FEATURE_TESTS_RESULT}" != "success" ]]; then
echo "Required job 'feature_tests' did not succeed."
exit 1
fi
# gen_docs is skipped for fork PRs by design; treat that as acceptable.
if [[ "${GEN_DOCS_RESULT}" != "success" && "${GEN_DOCS_RESULT}" != "skipped" ]]; then
echo "Required job 'gen_docs' failed or was cancelled."
exit 1
fi
echo "All required jobs completed successfully."