Skip to content

Version Packages (#107) #435

Version Packages (#107)

Version Packages (#107) #435

Workflow file for this run

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: ['2.7', '3.0', '3.1']
node-version: [16.x, 18.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@v3
# - 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"
- uses: pnpm/action-setup@v2
with:
version: 8.x.x
run_install: false
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: |
pnpm-lock.yaml
tests/rails/pnpm-lock.yaml
- name: Install via pnpm
run: |
pnpm run setup
- 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 exec playwright install --with-deps
pnpm run test:docs
- name: Unit Tests
run: |
pnpm run test:unit