Repository navigation
113 lines (110 loc) · 3.93 KB
/
Copy pathci.yml
File metadata and controls
113 lines (110 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
on:
pull_request:
schedule:
# Run every Friday to ensure everything works as expected.
- cron: '0 6 * * 5'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: DavidAnson/markdownlint-cli2-action@v25
with:
globs: src/en/**/*.md
screenshots:
runs-on: ubuntu-latest
needs: lint
env:
CI_COMMIT_REF_NAME: ${{github.ref_name}}
CI_JOB_ID: ${{github.job}}
outputs:
sha_short: ${{ steps.sha.outputs.sha_short }}
screenshots-artifact-url: ${{ steps.screenshots-artifact.outputs.artifact-url }}
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v7
with:
repository: zammad/zammad-docker-compose
path: zammad-docker-compose
- run: .screenshots/zammad-stack/start.sh
- run: |
.screenshots/zammad-stack/screenshots.sh
test -d src/public/screenshots/cypress # check that screenshots were copied from the container
- run: .screenshots/zammad-stack/stop.sh
- id: sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v7
id: screenshots-artifact
with:
name: screenshots-${{ steps.sha.outputs.sha_short }}
path: src/public/screenshots/cypress
build:
runs-on: ubuntu-latest
needs: screenshots
# Throwaway search index for the checks below, see .vitepress/search/. The
# keys are made up for this job; GitHub never gets production credentials.
services:
typesense:
image: typesense/typesense:30.2
env:
TYPESENSE_API_KEY: ci-check-admin-key
TYPESENSE_DATA_DIR: /tmp
ports:
- 8108:8108
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: screenshots-${{ needs.screenshots.outputs.sha_short }}
path: src/public/screenshots/cypress
- uses: pnpm/action-setup@v6
# The search scripts run as TypeScript with Node's type stripping.
- uses: actions/setup-node@v7
with:
node-version: 24
# po4a generates the content of the non-English locales.
- run: sudo apt-get update && sudo apt-get install -y po4a
- run: pnpm install
# Builds every language into its own directory below dist/, and its search
# documents into search-index/.
- run: pnpm build
# The local search of VitePress must not come back.
- run: "! grep -rl --include='*.js' localSearchIndex dist/"
- run: pnpm search:index en de sr it pt_BR
env:
TYPESENSE_URL: http://localhost:8108
TYPESENSE_ADMIN_KEY: ci-check-admin-key
TYPESENSE_SEARCH_KEY: ci-check-search-key
- run: pnpm search:check en de sr it pt_BR
env:
TYPESENSE_URL: http://localhost:8108
TYPESENSE_SEARCH_KEY: ci-check-search-key
# The MCP server (mcp/): RuboCop and the specs, then the specs against the
# build output and the index above.
- uses: ruby/setup-ruby@v1
with:
working-directory: mcp
bundler-cache: true
- run: bundle exec rubocop && bundle exec rspec
working-directory: mcp
- run: bundle exec rspec --tag integration
working-directory: mcp
env:
MCP_INTEGRATION: 1
TYPESENSE_URL: http://localhost:8108
TYPESENSE_SEARCH_KEY: ci-check-search-key
- uses: actions/upload-artifact@v7
id: build-artifact
with:
name: build-${{ needs.screenshots.outputs.sha_short }}
path: dist
- if: github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v3
with:
comment-tag: artifacts
message: |
### Artifacts
Produced during runtime
📦 [build-${{ needs.screenshots.outputs.sha_short }}](${{ steps.build-artifact.outputs.artifact-url }})
📦 [screenshots-${{ needs.screenshots.outputs.sha_short }}](${{ needs.screenshots.outputs.screenshots-artifact-url }})