main -> latest #745
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.3', '3.2'] | |
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 | |