From e82830aee663bc2dc474a6c5fb72cfdbca7d2a65 Mon Sep 17 00:00:00 2001 From: Adam Hutchison Date: Sun, 3 Mar 2024 18:28:49 -0700 Subject: [PATCH] Setup GitHub Actions to test and lint Add a CI action that runs test and lint jobs on pushes and pull requests to main. --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c89bf51 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +# This workflow uses actions that are not certified by GitHub. They are +# provided by a third-party and are governed by separate terms of service, +# privacy policy, and support documentation. +# +# This workflow will install a prebuilt Ruby version, install dependencies, and +# run tests and linters. +name: "CI" +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] +jobs: + lint: + runs-on: ubuntu-latest + env: + RAILS_ENV: test + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Lint with the Standard Ruby style guide + run: bin/rake standard + test: + runs-on: ubuntu-latest + env: + RAILS_ENV: test + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Run all specs in spec directory + run: bin/rake spec +