Skip to content

E2E test for Codeplain installation and rendering Hello World! #5

E2E test for Codeplain installation and rendering Hello World!

E2E test for Codeplain installation and rendering Hello World! #5

Workflow file for this run

# .github/workflows/e2e.yml
name: E2E
on:
pull_request: # TODO remove before merging to main
schedule:
- cron: '0 5 * * *' # nightly to catch API drift
workflow_dispatch:
jobs:
e2e-linux:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install pytest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build E2E image (cached)
uses: docker/build-push-action@v5
with:
context: .
file: tests/e2e/Dockerfile
tags: codeplain-e2e:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run E2E tests
env:
CODEPLAIN_API_KEY: ${{ secrets.CODEPLAIN_API_KEY }}
run: pytest tests/e2e/ -v --tb=short
- name: Upload generated outputs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-outputs-linux
path: /tmp/pytest-of-runner/**/container_work*/**
# Slice 1: smoke-test that install.ps1 runs non-interactively on a real
# windows-latest runner. The pytest-based render/run flow will be added in a
# follow-up commit once this is green.
e2e-windows:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Run install.ps1 non-interactively
env:
CODEPLAIN_API_KEY: ${{ secrets.CODEPLAIN_API_KEY }}
CODEPLAIN_INSTALL_NONINTERACTIVE: '1'
shell: pwsh
run: ./install/powershell/install.ps1
- name: Verify codeplain is installed
shell: pwsh
run: |
# install.ps1 persists PATH changes to the user registry but the
# current pwsh session has a stale Path. Refresh it from the registry
# so `codeplain` is discoverable here.
$env:Path = [Environment]::GetEnvironmentVariable('Path', 'User') + ';' + [Environment]::GetEnvironmentVariable('Path', 'Machine')
codeplain --help