Bump docker/setup-buildx-action from 2 to 3 #2839
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: CI | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
RUBYOPT: "-W:no-deprecated" | |
RAILS_ENV: test | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432 | |
services: | |
postgres: | |
image: postgres:12.2 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: app_test | |
ports: [ "5432:5432" ] | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Update file watchers because of rails settings cached | |
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
- name: Read .tool-versions | |
uses: marocchino/tool-versions-action@v1 | |
id: versions | |
- name: Use Node.js ${{ steps.versions.outputs.nodejs}} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.versions.outputs.nodejs}} | |
- name: Install ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ steps.versions.outputs.ruby}} | |
bundler-cache: true | |
- name: Cache NPM dependencies | |
uses: actions/cache@v3.2.6 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-npm- | |
- name: Install NPM dependencies | |
run: npm install | |
- name: Run prettier | |
run: npm run prettier | |
- name: Build JS | |
run: npm run build:js | |
- name: Build CSS | |
run: npm run build:css | |
- name: Run database migrations | |
run: bin/rails db:migrate | |
- name: Run rubocop | |
run: bundle exec rubocop | |
- name: Run tests | |
run: bin/rake spec |