Skip to content
Open
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
92 changes: 80 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
env:
# Test database.
TEST_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/river_test?sslmode=disable
NODE_VERSION: &node_version "24.14.1"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reference syntax is new right? Kind of nice to finally have it.

May alphabetize these vars for general nicety.


on:
push:
Expand Down Expand Up @@ -40,7 +41,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v6
Expand Down Expand Up @@ -99,7 +100,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- uses: actions/setup-go@v6
with:
Expand Down Expand Up @@ -133,7 +134,7 @@ jobs:
strategy:
matrix:
node-version:
- "22.18.0"
- *node_version
fail-fast: false
timeout-minutes: 5

Expand All @@ -145,10 +146,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
cache: "npm"
cache-dependency-path: package-lock.json
Expand All @@ -170,7 +171,7 @@ jobs:
strategy:
matrix:
node-version:
- "22.18.0"
- *node_version
fail-fast: false
timeout-minutes: 5

Expand All @@ -179,10 +180,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
cache: "npm"
cache-dependency-path: package-lock.json
Expand All @@ -194,7 +195,7 @@ jobs:

- name: Cache ESLint
id: cache-eslint
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: .eslintcache
key: eslint-v1-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -209,6 +210,73 @@ jobs:
# Check tsc compilation even if there were linting issues:
if: always()

js_storybook_and_visual:
name: Storybook and visual regression
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- *node_version
fail-fast: false
timeout-minutes: 20

env:
NODE_ENV: test

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v6
with:
cache: "npm"
cache-dependency-path: package-lock.json
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
shell: sh

- name: Install Playwright browser dependencies
run: npx playwright install --with-deps chromium

- name: Storybook story tests
run: npm run test-storybook

- name: Visual regression tests
run: npm run test-visual

- name: Upload Playwright HTML report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
if-no-files-found: ignore
name: playwright-report
path: playwright-report/

- name: Upload Playwright test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
if-no-files-found: ignore
name: playwright-test-results
path: test-results/

- name: Visual test summary
if: ${{ !cancelled() }}
run: |
{
echo "### Storybook visual regression";
echo "";
echo "- Job result: \`${{ job.status }}\`";
echo "- Artifacts: \`playwright-report\`, \`playwright-test-results\`";
echo "- Download from this run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}";
} >> "$GITHUB_STEP_SUMMARY"

release:
name: Release
permissions:
Expand All @@ -218,7 +286,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
Expand All @@ -227,11 +295,11 @@ jobs:
go-version-file: "go.mod"

- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
cache: "npm"
cache-dependency-path: package-lock.json
node-version: "22.18.0"
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm install
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/docker-riverproui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || github.ref }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ env.ECR_ROLE_ARN }}
aws-region: ${{ env.ECR_REGION }}
Expand All @@ -74,11 +74,11 @@ jobs:
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4

- name: Docker meta for Pro
id: meta-pro
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
with:
images: ${{ format('{0}.dkr.ecr.{1}.amazonaws.com/riverqueue/riverproui', env.ECR_ACCOUNT_ID, env.ECR_REGION) }}
labels: |
Expand All @@ -88,7 +88,7 @@ jobs:

- name: Build & push (by digest)
id: build-pro
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile.pro
Expand All @@ -109,7 +109,7 @@ jobs:
touch "/tmp/digests/${digest#sha256:}"

- name: Upload digest
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: pro-digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

steps:
- name: Checkout full history (no tags yet)
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || github.ref }}
fetch-depth: 0 # full history
Expand All @@ -151,16 +151,16 @@ jobs:
run: git fetch --tags --force

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4

- name: Set up ORAS CLI
uses: oras-project/setup-oras@v1
uses: oras-project/setup-oras@v2

- name: Install Cosign
uses: sigstore/cosign-installer@v3
uses: sigstore/cosign-installer@v4.1.1

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ env.ECR_ROLE_ARN }}
aws-region: ${{ env.ECR_REGION }}
Expand All @@ -170,7 +170,7 @@ jobs:
uses: aws-actions/amazon-ecr-login@v2

- name: Download digests
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
path: /tmp/digests
pattern: pro-digests-*
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
with:
images: ${{ env.ECR_IMAGE }}
tags: |
Expand Down Expand Up @@ -292,7 +292,7 @@ jobs:
fi

- name: Install crane
uses: imjasonh/setup-crane@v0.4
uses: imjasonh/setup-crane@v0.5

- name: Compute manifest digest for attestation
id: manifest_digest
Expand All @@ -302,7 +302,7 @@ jobs:

- name: Generate build provenance attestation (not pushed)
id: attest
uses: actions/attest-build-provenance@v2
uses: actions/attest-build-provenance@v4
with:
push-to-registry: false
subject-digest: ${{ steps.manifest_digest.outputs.digest }}
Expand Down Expand Up @@ -367,7 +367,7 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || github.ref }}
fetch-depth: 0 # full history
Expand Down Expand Up @@ -432,20 +432,20 @@ jobs:
done

- name: Login to live registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: riverqueue.com
username: river
password: ${{ secrets.RIVERPRO_GO_MOD_CREDENTIAL }}

- name: Install crane
uses: imjasonh/setup-crane@v0.4
uses: imjasonh/setup-crane@v0.5

- name: Set up ORAS CLI
uses: oras-project/setup-oras@v1
uses: oras-project/setup-oras@v2

- name: Install Cosign
uses: sigstore/cosign-installer@v3
uses: sigstore/cosign-installer@v4.1.1

- name: Resolve manifest digest
id: resolve-digest
Expand Down Expand Up @@ -584,7 +584,7 @@ jobs:

- name: Upload debug artifacts
if: failure() || cancelled()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: prefetch-debug
path: |
Expand Down
Loading
Loading