-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (85 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
91 lines (85 loc) · 2.39 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
name: CI
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- run: bundle exec bundler-audit --update
- run: bundle exec rubocop --parallel
test:
name: Test (Ruby ${{ matrix.ruby }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.2', '3.3', '3.4']
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: RAILS_ENV=test bundle exec rake -f spec/dummy/Rakefile db:schema:load
- run: bundle exec rspec
deploy-docs:
name: Deploy Docs
needs: [lint, test]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- uses: pnpm/action-setup@v6
with:
package_json_file: docs/package.json
- uses: actions/setup-node@v6
with:
node-version-file: docs/.nvmrc
cache: pnpm
cache-dependency-path: docs/pnpm-lock.yaml
- run: cd docs && pnpm install --frozen-lockfile
- env:
RAILS_ENV: test
run: |
cd docs/playground
bundle install
bundle exec rake db:setup
bundle exec rake apiwork:docs:reference
bundle exec rake docs:generate
- run: cd docs && pnpm run build
- uses: actions/upload-pages-artifact@v5
with:
path: docs/.vitepress/dist
- uses: actions/deploy-pages@v5
id: deploy
all-green:
name: All checks passing
if: always()
needs: [lint, test, deploy-docs]
runs-on: ubuntu-latest
steps:
- run: |
[[ "${{ needs.lint.result }}" == "success" ]] || exit 1
[[ "${{ needs.test.result }}" == "success" ]] || exit 1
[[ "${{ needs.deploy-docs.result }}" =~ ^(success|skipped)$ ]] || exit 1