-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup GitHub Actions to test and lint
Add a CI action that runs test and lint jobs on pushes and pull requests to main.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|