Skip to content
Draft
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
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CI

on:
push:
branches: [develop, beta]
pull_request:
branches: [develop, beta]

jobs:
build-and-test:
name: ${{ matrix.command_description }}
uses: ./.github/workflows/test.yml
strategy:
fail-fast: true
matrix:
include:
- command_description: Build
command: npm run build
needs_lfs: false
needs_playwright: false
- command_description: Lint
command: npm run lint
needs_lfs: false
needs_playwright: false
- command_description: Less Tests
command: npm run test:less -w packages/stacks-classic
needs_lfs: false
needs_playwright: false
- command_description: Unit Tests
command: npm run test:unit -w packages/stacks-classic -- --config web-test-runner.config.ci.mjs
needs_lfs: false
needs_playwright: true
- command_description: A11y Tests
command: npm run test:a11y -w packages/stacks-classic -- --config web-test-runner.config.ci.mjs
needs_lfs: false
needs_playwright: true
- command_description: Visual Regression Tests
command: npm run test:visual:ci -w packages/stacks-classic -- --config ./visual-runner/stacks-classic-runner-config/web-test-runner.config.ci.mjs
needs_lfs: true
needs_playwright: false # we are using playwright docker image to run visual tests
with:
command: ${{ matrix.command }}
command_description: ${{ matrix.command_description }}
needs_playwright: ${{ matrix.needs_playwright }}
needs_lfs: ${{ matrix.needs_lfs }}
release:
name: Release (latest or beta)
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta'
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "npm"
- name: Install dependencies
run: |
npm ci
npm run build
- name: 🚀 Create/Update Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: npm run version
publish: npm run release
title: "chore(new-release)"
commit: "chore(new-release)"
branch: ${{ github.ref == 'refs/heads/beta' && 'beta' || null }}
createGithubReleases: ${{ github.ref == 'refs/heads/develop' }}
env:
GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }}
NPM_TOKEN: ${{ secrets.NPM_API_KEY }}
- name: 🔄 Update stackoverflow.design docs
# Only run this step if publish succeeded and actually released something
if: ${{ steps.changesets.outputs.published == 'true' && github.ref_name == 'develop' }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git fetch origin
git checkout production
git merge --no-ff --allow-unrelated-histories origin/develop -m "chore: merge develop into production"
git push origin production
env:
GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }}

# cancel the jobs if another workflow is kicked off for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
67 changes: 0 additions & 67 deletions .github/workflows/release.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/workflow.yml

This file was deleted.