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
138 changes: 135 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,85 @@
name: Deploy
on:
workflow_call:
inputs:
ref:
description: Git ref containing the Docs release
required: true
type: string
expectedVersion:
description: Release version expected from the deployed health endpoint
required: true
type: string
expectedCommit:
description: Commit expected from the deployed health endpoint
required: true
type: string
workflow_dispatch:
release:
types: [published]
inputs:
ref:
description: Git ref to deploy
required: true
default: main
type: string
expectedVersion:
description: Optional release version; inferred from version tags or reported as unreleased
required: false
type: string
expectedCommit:
description: Optional commit assertion; defaults to the selected ref's commit
required: false
type: string

concurrency:
group: fsharp-viewengine-production
cancel-in-progress: false

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment:
name: production
url: https://fsharpviewengine.meiermade.com
permissions:
contents: read
id-token: write
outputs:
version: ${{ steps.release.outputs.version }}
commit: ${{ steps.release.outputs.commit }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Resolve release metadata
id: release
env:
REQUESTED_VERSION: ${{ inputs.expectedVersion }}
EXPECTED_COMMIT: ${{ inputs.expectedCommit }}
DEPLOY_REF: ${{ inputs.ref }}
run: |
version="$REQUESTED_VERSION"
if [[ -z "$version" ]]; then
if [[ "$DEPLOY_REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="${DEPLOY_REF#v}"
else
version="unreleased"
fi
fi

commit="$EXPECTED_COMMIT"
if [[ -z "$commit" ]]; then
commit="$(git rev-parse HEAD)"
fi

actual_commit="$(git rev-parse HEAD)"
if [[ "$commit" != "$actual_commit" ]]; then
echo "Expected commit $commit, but $DEPLOY_REF resolved to $actual_commit." >&2
exit 1
fi

echo "version=$version" >> "$GITHUB_OUTPUT"
echo "commit=$commit" >> "$GITHUB_OUTPUT"
- name: Setup Node
uses: actions/setup-node@v5
with:
Expand All @@ -21,7 +89,7 @@ jobs:
with:
install_components: gke-gcloud-auth-plugin
- name: Install Packages
run: npm install
run: npm ci
working-directory: ./pulumi
- name: Authenticate Pulumi
uses: pulumi/auth-actions@v1
Expand All @@ -31,7 +99,71 @@ jobs:
scope: user:meiermade
- name: Deploy
uses: pulumi/actions@v6
env:
RELEASE_VERSION: ${{ steps.release.outputs.version }}
RELEASE_COMMIT: ${{ steps.release.outputs.commit }}
with:
work-dir: ./pulumi
command: up
stack-name: prod

e2e:
name: E2E
needs: deploy
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
ref: ${{ needs.deploy.outputs.commit }}
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
cache-dependency-path: e2e/package-lock.json
- name: Install E2E packages
run: npm ci
working-directory: ./e2e
- name: Install Firefox
run: npx playwright install --with-deps firefox
working-directory: ./e2e
- name: Wait for deployed Docs release
env:
EXPECTED_VERSION: ${{ needs.deploy.outputs.version }}
EXPECTED_COMMIT: ${{ needs.deploy.outputs.commit }}
run: |
for _ in $(seq 1 60); do
health="$(curl --fail --silent --show-error https://fsharpviewengine.meiermade.com/health || true)"
status="$(jq -r '.status // empty' <<< "$health" 2>/dev/null || true)"
version="$(jq -r '.version // empty' <<< "$health" 2>/dev/null || true)"
commit="$(jq -r '.commit // empty' <<< "$health" 2>/dev/null || true)"

if [[ "$status" == "ok" && "$version" == "$EXPECTED_VERSION" && "$commit" == "$EXPECTED_COMMIT" ]]; then
exit 0
fi

echo "Waiting for Docs $EXPECTED_VERSION at $EXPECTED_COMMIT; found version=${version:-unknown}, commit=${commit:-unknown}."
sleep 5
done

echo "FSharp.ViewEngine Docs did not report the expected release." >&2
exit 1
- name: Test deployed Docs
run: npm run test:published
working-directory: ./e2e
env:
DOCS_E2E_BASE_URL: https://fsharpviewengine.meiermade.com
DOCS_EXPECTED_VERSION: ${{ needs.deploy.outputs.version }}
DOCS_EXPECTED_COMMIT: ${{ needs.deploy.outputs.commit }}
- name: Upload E2E diagnostics
if: failure()
uses: actions/upload-artifact@v4
with:
name: fsharp-viewengine-deploy-e2e
path: |
e2e/playwright-report
e2e/test-results
if-no-files-found: ignore
67 changes: 59 additions & 8 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Preview
on:
pull_request:
paths-ignore:
- '**/*.md'
branches:
- main
jobs:
test:
name: Test
unit:
name: Unit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Expand All @@ -20,20 +20,68 @@ jobs:
run: dotnet tool restore
working-directory: ./sln
- name: Install Packages
run: dotnet paket install
run: |
dotnet paket install
dotnet restore FSharp.ViewEngine.slnx
working-directory: ./sln
- name: Build solution
run: dotnet build FSharp.ViewEngine.slnx --configuration Release --no-restore
working-directory: ./sln
- name: Test
run: ./fake.sh Test
working-directory: ./sln
- name: Pack
run: dotnet pack src/FSharp.ViewEngine/FSharp.ViewEngine.fsproj --configuration Release --no-restore --output "$RUNNER_TEMP/package" /p:PackageVersion=0.0.0-preview
working-directory: ./sln
- name: Verify package compatibility
env:
PACKAGE_PATH: ${{ runner.temp }}/package/FSharp.ViewEngine.0.0.0-preview.nupkg
run: ./fake.sh VerifyPackage --single-target
working-directory: ./sln

e2e:
name: E2E
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
cache-dependency-path: e2e/package-lock.json
- name: Install E2E packages
run: npm ci
working-directory: ./e2e
- name: Install Firefox
run: npx playwright install --with-deps firefox
working-directory: ./e2e
- name: Test production Docs image
run: npm test -- --project=firefox
working-directory: ./e2e
- name: Upload E2E diagnostics
if: failure()
uses: actions/upload-artifact@v4
with:
name: fsharp-viewengine-preview-e2e
path: |
e2e/playwright-report
e2e/test-results
/tmp/fsharp-viewengine-e2e
if-no-files-found: ignore

preview:
name: Preview
# Keep this terminal job named Test because it is the protected branch check.
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write
needs:
- test
- unit
- e2e
steps:
- uses: actions/checkout@v5
- name: Setup Node
Expand All @@ -45,7 +93,7 @@ jobs:
with:
install_components: gke-gcloud-auth-plugin
- name: Install Packages
run: npm install
run: npm ci
working-directory: ./pulumi
- name: Authenticate Pulumi
uses: pulumi/auth-actions@v1
Expand All @@ -55,6 +103,9 @@ jobs:
scope: user:meiermade
- name: Preview
uses: pulumi/actions@v6
env:
RELEASE_VERSION: preview
RELEASE_COMMIT: ${{ github.event.pull_request.head.sha }}
with:
work-dir: ./pulumi
command: preview
Expand Down
Loading
Loading