WIP: chore: refactor to completly new build system #2394
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: node tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CI: "true" | |
jobs: | |
commitlint: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: wagoid/commitlint-github-action@v5 | |
node: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: install | |
run: | | |
corepack enable | |
pnpm i --frozen-lockfile | |
env: | |
CYPRESS_INSTALL_BINARY: 0 | |
- name: unit test | |
run: | | |
pnpm test:unit | |
- name: lint | |
run: | | |
pnpm lint | |
- name: types | |
run: | | |
pnpm test:ts | |
ct: | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node-22.13.0-chrome-131.0.6778.264-1-ff-134.0-edge-131.0.2903.112-1 | |
options: --user 1001 | |
strategy: | |
matrix: | |
container: [1, 2, 3, 4] | |
browser: [firefox, chrome] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install Deps | |
run: | | |
corepack enable | |
pnpm i --frozen-lockfile | |
- name: Run Cypress | |
uses: cypress-io/github-action@v6 | |
with: | |
component: true | |
install: false | |
record: true | |
parallel: true | |
group: ${{ matrix.browser }}-ct | |
ci-build-id: "${{github.sha}}-${{ github.workflow }}-${{ github.event_name }}" | |
browser: ${{ matrix.browser}} | |
command-prefix: "pnpm" | |
env: | |
CYPRESS_RECORD_KEY: 0af1d817-e8ac-4c69-ac15-c0da1e69182d | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
e2e: | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node-22.13.0-chrome-131.0.6778.264-1-ff-134.0-edge-131.0.2903.112-1 | |
options: --user 1001 | |
strategy: | |
matrix: | |
container: [1, 2, 3, 4] | |
browser: [firefox, chrome] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install Deps | |
run: | | |
corepack enable | |
pnpm i --frozen-lockfile | |
- name: Run Cypress | |
uses: cypress-io/github-action@v6 | |
with: | |
install: false | |
record: true | |
parallel: true | |
build: pnpm build | |
group: ${{ matrix.browser }} | |
ci-build-id: "${{github.sha}}-${{ github.workflow }}-${{ github.event_name }}" | |
start: pnpm vinxi start | |
wait-on: http://localhost:9042 | |
browser: ${{ matrix.browser}} | |
command-prefix: "percy exec --parallel -- pnpm" | |
env: | |
PERCY_TOKEN: web_63aaa4d04fb56e5bb41b4547417eac37310a4b8dd2ef6f2e6e444215eacb01b3 | |
PERCY_BROWSER_EXECUTABLE: /usr/bin/google-chrome | |
CYPRESS_RECORD_KEY: 0af1d817-e8ac-4c69-ac15-c0da1e69182d | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PORT: 9042 | |
NODE_ENV: production | |
TEST_RUN: 1 | |
finalizePercy: | |
runs-on: ubuntu-latest | |
needs: | |
- e2e | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: finalize percy | |
run: | | |
corepack enable | |
pnpm i --frozen-lockfile | |
pnpm percy build:finalize | |
env: | |
PERCY_TOKEN: web_63aaa4d04fb56e5bb41b4547417eac37310a4b8dd2ef6f2e6e444215eacb01b3 | |
docker: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: docker | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: marudor/bahn.expert/standalone | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
platforms: linux/amd64,linux/arm64 | |
tags: "latest,${{ github.sha }}" | |
createDeploy: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- docker | |
- e2e | |
- node | |
- ct | |
steps: | |
- name: "Create Deployment" | |
uses: avakar/create-deployment@v1.0.2 | |
with: | |
ref: ${{ github.sha }} | |
task: deploy | |
environment: beta | |
required_contexts: docker | |
payload: '{"value_files": ["./config/_common.yml","./config/beta.yml"],"release": "bahn-expert-beta","namespace": "marudor","track": "stable"}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }} |