Skip to content

Commit

Permalink
Add GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkhan committed Aug 6, 2024
1 parent b303490 commit 7a03c67
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/example_minitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Example Schema Snapshot Test

on:
pull_request:
push:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

defaults:
run:
working-directory: example

env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432

services:
postgres:
image: postgres:16.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options:
--health-cmd="pg_isready" --health-interval=10s --health-timeout=5s
--health-retries=3

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: example
ruby-version: .ruby-version
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Set up database
run: |
bin/rails db:create
bin/rails db:schema:load
- name: Run tests
run: bin/rails test -b
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# JSON:API Resource Schema Generation: Anchor

![example](https://github.com/mattkhan/jsonapi-resources-anchor/actions/workflows/example_minitest.yml/badge.svg)

Easily generate TypeScript schemas, JSON Schemas, or any schema of your choice
from [cerebris/jsonapi-resources](https://github.com/cerebris/jsonapi-resources)
`JSONAPI::Resource` classes.
Expand Down

0 comments on commit 7a03c67

Please sign in to comment.