Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ permissions:
jobs:
ci:
name: CI
uses: 0xPlayerOne/code-foundry/.github/workflows/reusable-ci.yml@v0.6.0
uses: 0xPlayerOne/code-foundry/.github/workflows/reusable-ci.yml@v0.7.0
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: Code Foundry runtime tag or ref.
required: false
type: string
default: v0.5.0
default: v0.7.0

permissions:
contents: read
Expand Down
243 changes: 243 additions & 0 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
name: Code Foundry Test

on:
workflow_call:
inputs:
runtime-repository:
description: Repository containing the Code Foundry runtime.
required: false
type: string
default: 0xPlayerOne/code-foundry
runtime-ref:
description: Code Foundry runtime tag or ref.
required: false
type: string
default: v0.7.0

permissions:
contents: read

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
REPO_FOUNDRY_PROFILE: ${{ vars.REPO_FOUNDRY_PROFILE }}
REPO_FOUNDRY_LANGUAGES: ${{ vars.REPO_FOUNDRY_LANGUAGES }}
REPO_FOUNDRY_FEATURES: ${{ vars.REPO_FOUNDRY_FEATURES }}
REPO_FOUNDRY_PACKAGE_MANAGER: ${{ vars.REPO_FOUNDRY_PACKAGE_MANAGER }}
REPO_FOUNDRY_RUNNER: ${{ vars.REPO_FOUNDRY_RUNNER }}
REPO_FOUNDRY_CACHE_PACKAGES: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
REPO_FOUNDRY_CACHE_BUILD: ${{ vars.REPO_FOUNDRY_CACHE_BUILD || 'auto' }}
REPO_FOUNDRY_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before || '' }}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true

jobs:
unit:
name: Unit
runs-on: ${{ vars.REPO_FOUNDRY_UNIT_RUNNER || 'ubuntu-slim' }}
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Runtime
uses: actions/checkout@v7
with:
repository: ${{ inputs.runtime-repository }}
ref: ${{ inputs.runtime-ref }}
path: .code-foundry
sparse-checkout: |
.github/actions
.github/scripts
- name: Install runtime
run: |
mkdir -p .github/actions .github/scripts
cp -R .code-foundry/.github/actions/. .github/actions/
cp -R .code-foundry/.github/scripts/. .github/scripts/
- name: Detect
id: applicability
run: bash .github/scripts/ci.sh task_profile unit >> "$GITHUB_OUTPUT"
- name: Setup
if: steps.applicability.outputs.applicable == 'true'
uses: ./.github/actions/setup
with:
install: true
install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
install-python: ${{ steps.applicability.outputs.python == 'true' }}
install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
cache-build: false
cache-environment: false
cache-packages: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
task: unit
task-javascript: ${{ steps.applicability.outputs.javascript }}
task-python: ${{ steps.applicability.outputs.python }}
task-rust: ${{ steps.applicability.outputs.rust }}
- name: Unit
if: steps.applicability.outputs.applicable == 'true'
run: bash .github/scripts/ci.sh unit
- name: Upload coverage
if: >-
always() &&
steps.applicability.outputs.applicable == 'true' &&
hashFiles('coverage/**', 'htmlcov/**', '.coverage*', 'target/llvm-cov/**') != ''
uses: actions/upload-artifact@v7
with:
name: coverage-unit-${{ github.run_id }}
path: |
coverage/**
htmlcov/**
.coverage*
target/llvm-cov/**
compression-level: 1
if-no-files-found: ignore
retention-days: 14

integration:
name: Integration
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Runtime
uses: actions/checkout@v7
with:
repository: ${{ inputs.runtime-repository }}
ref: ${{ inputs.runtime-ref }}
path: .code-foundry
sparse-checkout: |
.github/actions
.github/scripts
- name: Install runtime
run: |
mkdir -p .github/actions .github/scripts
cp -R .code-foundry/.github/actions/. .github/actions/
cp -R .code-foundry/.github/scripts/. .github/scripts/
- name: Detect
id: applicability
run: bash .github/scripts/ci.sh task_profile integration >> "$GITHUB_OUTPUT"
- name: Setup
if: steps.applicability.outputs.applicable == 'true'
uses: ./.github/actions/setup
with:
install: true
install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
install-python: ${{ steps.applicability.outputs.python == 'true' }}
install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
cache-build: ${{ steps.applicability.outputs.rust == 'true' }}
cache-environment: false
cache-save: ${{ github.event_name == 'push' }}
task: integration
task-javascript: ${{ steps.applicability.outputs.javascript }}
task-python: ${{ steps.applicability.outputs.python }}
task-rust: ${{ steps.applicability.outputs.rust }}
- name: Integration
if: steps.applicability.outputs.applicable == 'true'
run: bash .github/scripts/ci.sh integration

e2e:
name: E2E
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Runtime
uses: actions/checkout@v7
with:
repository: ${{ inputs.runtime-repository }}
ref: ${{ inputs.runtime-ref }}
path: .code-foundry
sparse-checkout: |
.github/actions
.github/scripts
- name: Install runtime
run: |
mkdir -p .github/actions .github/scripts
cp -R .code-foundry/.github/actions/. .github/actions/
cp -R .code-foundry/.github/scripts/. .github/scripts/
- name: Detect
id: applicability
run: bash .github/scripts/ci.sh task_profile e2e >> "$GITHUB_OUTPUT"
- name: Cache browser binaries
if: steps.applicability.outputs.applicable == 'true' && steps.applicability.outputs.browser == 'true'
uses: ./.github/actions/cache
with:
save: ${{ github.event_name == 'push' }}
path: |
~/.cache/ms-playwright
~/.cache/Cypress
~/.cache/puppeteer
key: ${{ runner.os }}-e2e-browsers-${{ hashFiles('**/package.json', '**/bun.lock', '**/bun.lockb', '**/pnpm-lock.yaml', '**/yarn.lock', '**/package-lock.json', '**/playwright.config.*', '**/cypress.config.*') }}
restore-keys: |
${{ runner.os }}-e2e-browsers-
- name: Setup
if: steps.applicability.outputs.applicable == 'true'
uses: ./.github/actions/setup
with:
install: true
install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
install-python: ${{ steps.applicability.outputs.python == 'true' }}
install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
cache-build: false
cache-environment: false
cache-save: ${{ github.event_name == 'push' }}
task: e2e
task-javascript: ${{ steps.applicability.outputs.javascript }}
task-python: ${{ steps.applicability.outputs.python }}
task-rust: ${{ steps.applicability.outputs.rust }}
- name: E2E
if: steps.applicability.outputs.applicable == 'true'
run: bash .github/scripts/ci.sh e2e

smoke:
name: Smoke
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Runtime
uses: actions/checkout@v7
with:
repository: ${{ inputs.runtime-repository }}
ref: ${{ inputs.runtime-ref }}
path: .code-foundry
sparse-checkout: |
.github/actions
.github/scripts
- name: Install runtime
run: |
mkdir -p .github/actions .github/scripts
cp -R .code-foundry/.github/actions/. .github/actions/
cp -R .code-foundry/.github/scripts/. .github/scripts/
- name: Detect
id: applicability
run: bash .github/scripts/ci.sh task_profile smoke >> "$GITHUB_OUTPUT"
- name: Setup
if: steps.applicability.outputs.applicable == 'true'
uses: ./.github/actions/setup
with:
install: true
install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
install-python: ${{ steps.applicability.outputs.python == 'true' }}
install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
cache-build: false
cache-environment: false
cache-save: ${{ github.event_name == 'push' }}
task: smoke
task-javascript: ${{ steps.applicability.outputs.javascript }}
task-python: ${{ steps.applicability.outputs.python }}
task-rust: ${{ steps.applicability.outputs.rust }}
- name: Smoke
if: steps.applicability.outputs.applicable == 'true'
run: bash .github/scripts/ci.sh smoke