Skip to content

feat(ui): add theme presets config for workspace-defined color schemes #278

feat(ui): add theme presets config for workspace-defined color schemes

feat(ui): add theme presets config for workspace-defined color schemes #278

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
changes:
name: detect changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
ui: ${{ steps.filter.outputs.ui }}
go: ${{ steps.filter.outputs.go }}
infra: ${{ steps.filter.outputs.infra }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ui:
- 'ui/**'
go:
- '**.go'
- 'go.mod'
- 'go.sum'
- 'internal/**'
- 'cmd/**'
- 'pkg/**'
infra:
- 'Dockerfile'
- '.github/workflows/**'
- '.github/scripts/**'
test:
name: test
needs: changes
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.ui == 'true' || needs.changes.outputs.infra == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
if: ${{ needs.changes.outputs.ui == 'true' || needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
with:
node-version: 20
cache: npm
cache-dependency-path: ui/package-lock.json
- name: install frontend deps
if: ${{ needs.changes.outputs.ui == 'true' || needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: npm ci
working-directory: ui
- name: run GitHub workflow script tests
if: ${{ needs.changes.outputs.infra == 'true' }}
run: node --test .github/scripts/*.test.mjs
- name: run UI tests
if: ${{ needs.changes.outputs.ui == 'true' || needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: npm test
working-directory: ui
- name: build frontend
if: ${{ needs.changes.outputs.ui == 'true' || needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: npm run build
working-directory: ui
- name: build storybook
if: ${{ needs.changes.outputs.ui == 'true' }}
run: npm run build-storybook
working-directory: ui
- name: build demo
if: ${{ needs.changes.outputs.ui == 'true' }}
run: npm run build-demo
working-directory: ui
- uses: actions/setup-go@v5
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
with:
go-version-file: go.mod
cache: true
- name: go mod download
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: go mod download
- name: go vet
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: go vet ./...
- name: go test
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: |
RACE_FLAG=${{ github.event_name == 'pull_request' && '-race' || '' }}
go test ./... $RACE_FLAG -count=1 -coverprofile=coverage.out -covermode=atomic
- name: coverage summary
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: go tool cover -func=coverage.out | tail -1
- name: upload coverage artifact
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.out
retention-days: 30
- name: go build
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.infra == 'true' }}
run: go build -o /tmp/kiwifs .
docker:
name: docker build
runs-on: ubuntu-latest
needs: [changes]
if: ${{ needs.changes.outputs.infra == 'true' && github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: docker build (no push)
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: false
cache-from: type=gha
cache-to: type=gha,mode=max