-
-
Notifications
You must be signed in to change notification settings - Fork 10
105 lines (92 loc) · 2.68 KB
/
tests.yml
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
name: Tests
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
rails-test:
runs-on: ubuntu-latest
env:
CI: true
RAILS_ENV: test
AWS_S3_ACCESS_KEY: minioadmin
AWS_S3_SECRET_KEY: minioadmin
AWS_S3_ENDPOINT: http://127.0.0.1:9000
AWS_S3_REGION: us-east-1
strategy:
matrix:
ruby: ['3.2', '3.1']
node-version: [20.x]
services:
minio:
# fixme: let's not depend on external unofficial image
image: lazybit/minio
ports:
- 9000:9000
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
options: --name=minio --health-cmd "curl http://localhost:9000/minio/health/live" --health-interval=0.1s --health-timeout=5s --health-retries=20
steps:
- uses: actions/checkout@v4
# - uses: microsoft/playwright-github-action@v1
- run: wget https://dl.min.io/client/mc/release/linux-amd64/mc
- run: chmod +x ./mc
- run: ./mc alias set minio $AWS_S3_ENDPOINT $AWS_S3_ACCESS_KEY $AWS_S3_SECRET_KEY
- run: ./mc mb --ignore-existing minio/$AWS_S3_BUCKET
env:
AWS_S3_BUCKET: "my-bucket-${{ strategy.job-index }}"
- name: Install libvips
run: sudo apt update && sudo apt -y install libvips
- name: Set parallel workers env variable
run: echo "PARALLEL_WORKERS=$(expr $(nproc) \* 6)" >> $GITHUB_ENV
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
bundler-cache: true
working-directory: "tests/rails"
- name: Setup Node.js v20
uses: actions/setup-node@v4
with:
node-version: '20.x'
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install via pnpm
run: |
pnpm run setup
pnpm exec playwright install
- name: Lint
run: |
pnpm run lint
- name: Build
run: pnpm run build
- name: Rails Tests
env:
AWS_S3_BUCKET: "my-bucket-${{ strategy.job-index }}"
run: |
pnpm run test:rails
- name: Doc Tests
run: |
pnpm run test:docs
- name: Unit Tests
run: |
pnpm run test:unit