ci: wip - parallelizing pepr-excellent-example test suite #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E - Pepr Excellent Examples | |
permissions: read-all | |
on: | |
# workflow_dispatch: | |
# schedule: | |
# - cron: '0 4 * * *' # 12AM EST/9PM PST | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
# ref: Dynamic Actions | |
# https://frontside.com/blog/2022-12-12-dynamic-github-action-jobs/ | |
jobs: | |
# whereami: | |
# name: tbd | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: env-root | |
# run: | | |
# REPO_NAME="${GITHUB_REPOSITORY##*/}" | |
# echo "ROOT=${GITHUB_WORKSPACE%%/$REPO_NAME/$REPO_NAME}" >> "$GITHUB_ENV" | |
# - name: get-root | |
# run: | | |
# echo "$GITHUB_WORKSPACE" | |
# echo "$ROOT" | |
# pwd | |
# cd "$ROOT" | |
# pwd | |
# ls -la pepr/pepr | |
generate-matrix: | |
name: Generate Excellent Examples Matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.create-matrix.outputs.matrix }} | |
steps: | |
- name: clone pepr | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: defenseunicorns/pepr | |
path: pepr | |
- name: "set env: PEPR" | |
run: echo "PEPR=${GITHUB_WORKSPACE}/pepr}" >> "$GITHUB_ENV" | |
- name: clone pepr-excellent-examples | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: defenseunicorns/pepr-excellent-examples | |
path: pepr-excellent-examples | |
- name: "set env: PEXEX" | |
run: echo "PEXEX=${GITHUB_WORKSPACE}/pepr-excellent-examples" >> "$GITHUB_ENV" | |
# - name: setup node | |
# uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
# with: | |
# node-version: 20 | |
# cache: "npm" | |
- name: node version | |
run: node --version | |
- name: create matrix | |
run: node "$PEPR/.github/workflows/pepr-excellent-examples-matrix.js" | |
id: create-matrix | |
excellent-examples: | |
name: Run Excellent Example (${{ matrix.nickname }}) | |
runs-on: ubuntu-latest | |
if: needs.generate-matrix.outputs.matrix != '' | |
needs: | |
- generate-matrix | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: ${{fromJSON(needs.generate-matrix.outputs.matrix)}} | |
steps: | |
- name: print matrix | |
run: | | |
echo "${{ matrix.package }}" | |
# - uses: actions/github-script@v7 | |
# id: create-matrix | |
# with: | |
# result-encoding: string | |
# script: | | |
# return "Hello!" | |
# - name: Get result | |
# run: echo "${{steps.set-result.outputs.result}}" | |
# - uses: actions/checkout@v3 | |
# - run: yarn | |
# - run: node ./matrix-script.js | |
# id: create-matrix | |
# jobs: | |
# e2e-pepr-excellent-examples: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
# - name: Use Node.js latest | |
# uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
# with: | |
# node-version: 20 | |
# cache: "npm" | |
# - name: "Install K3d" | |
# run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash" | |
# shell: bash | |
# - name: Install Pepr Dependencies | |
# run: npm ci | |
# - name: Create the Pepr dist Folder | |
# run: npm run test:journey:build | |
# - name: Create K3d Cluster | |
# run: npm run test:journey:k3d | |
# - name: Build Dev Image and Inject into Cluster | |
# run: npm run test:journey:image | |
# - name: Checkout Excellent Examples | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: defenseunicorns/pepr-excellent-examples | |
# path: 'pepr-excellent-examples' | |
# - name: Install Excellent Example Dependencies | |
# run: npm ci | |
# working-directory: pepr-excellent-examples | |
# - name: Run E2E Tests | |
# run: npm run test:e2e -- -i pepr:dev | |
# working-directory: pepr-excellent-examples |