Add OpenAPI 3.0 documentation #762
This file contains hidden or 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: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| RSpec: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| alchemy_branch: | |
| - 8.2-stable | |
| - 8.3-stable | |
| - main | |
| ruby: | |
| - "3.3" | |
| - "3.4" | |
| - "4.0" | |
| env: | |
| ALCHEMY_BRANCH: ${{ matrix.alchemy_branch }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Restore apt cache | |
| id: apt-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/apt/cache | |
| key: apt-sqlite- | |
| - name: Install SQLite headers | |
| run: | | |
| sudo mkdir -p /home/runner/apt/cache | |
| sudo apt-get update -qq | |
| sudo apt-get install -qq --fix-missing libsqlite3-dev -o dir::cache::archives="/home/runner/apt/cache" | |
| sudo chown -R runner /home/runner/apt/cache | |
| - name: Build and test with RSpec | |
| env: | |
| RAILS_ENV: test | |
| DB_USER: user | |
| DB_PASSWORD: password | |
| run: bundle exec rake | |
| OpenAPI: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| ALCHEMY_BRANCH: main | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: true | |
| - name: Restore apt cache | |
| id: apt-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/apt/cache | |
| key: apt-sqlite- | |
| - name: Install SQLite headers | |
| run: | | |
| sudo mkdir -p /home/runner/apt/cache | |
| sudo apt-get update -qq | |
| sudo apt-get install -qq --fix-missing libsqlite3-dev -o dir::cache::archives="/home/runner/apt/cache" | |
| sudo chown -R runner /home/runner/apt/cache | |
| - name: Regenerate OpenAPI spec | |
| env: | |
| RAILS_ENV: test | |
| OPENAPI: "1" | |
| run: bundle exec rake | |
| - name: Check for OpenAPI spec drift | |
| run: | | |
| if ! git diff --ignore-all-space --exit-code docs/openapi.yml; then | |
| echo "::error::docs/openapi.yml is out of date. Run 'OPENAPI=1 bundle exec rspec' locally and commit the result." | |
| exit 1 | |
| fi | |
| Vitest: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| NODE_ENV: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore node modules cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('./package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run Vitest | |
| run: pnpm run test |