Skip to content

Examples CI

Examples CI #1709

Workflow file for this run

name: Examples CI
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
version:
type: choice
description: Run against
required: true
options:
- workspace
- release
pull_request:
branches:
- main
- next
paths:
- '.github/actions/go/action.yaml'
- '.github/actions/node/action.yaml'
- '.github/workflows/examples-ci.yaml'
- 'examples/**'
- 'scripts/test-examples/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
env:
WG_TELEMETRY_DISABLED: 1
WORKING_DIRECTORY: '.'
CI: true
jobs:
collect:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: |
echo "matrix=$(./scripts/test-examples/collect.sh)" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
build_test_examples:
needs: collect
strategy:
matrix:
test: ${{ fromJson(needs.collect.outputs.matrix) }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/go
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
- uses: ./.github/actions/node
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
node-version: '18'
- name: Filter tests to run
run: |
echo '${{ toJson(matrix.test) }}' > tmp.json
echo "TEST_FILTER=$(jq -rc '.[]' tmp.json | tr '\n' ' ')" >> $GITHUB_ENV
rm -f tmp.json
- name: Bootstrap PNPM workspace
run: ./scripts/pnpm.sh
- name: Build libs
run: pnpm build:libs
- uses: ./.github/actions/wunderctl
- name: Run tests
run: ./scripts/test-examples/all.sh
- name: Check if git is not dirty after generating files
run: git diff --no-ext-diff --exit-code
# See https://github.com/orgs/community/discussions/26822
build_test:
if: ${{ always() }}
runs-on: ubuntu-latest
name: build_test
needs: build_test_examples
steps:
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}