Give titan conversation ability #525
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 | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
pull_request: | |
types: [opened, reopened, edited] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
eslint: | |
name: Eslint | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Include node and yarn | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install JS dependencies | |
run: | | |
yarn install | |
- name: Run ESlint | |
run: node_modules/.bin/eslint --ext .js ./app | |
rubocop: | |
name: Rubocop | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install ruby dependencies | |
uses: ruby/setup-ruby@v1 # https://github.com/ruby/setup-ruby | |
with: | |
bundler-cache: true | |
ruby-version: 3.3.0 | |
- name: Run rubocop | |
run: | | |
bundle exec rubocop | |
yarn_audit: | |
name: Yarn audit | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Include node and yarn | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Run yarn audit | |
run: | | |
yarn audit --groups dependencies | |
brakeman: | |
name: Brakeman | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Run Brakeman | |
run: | | |
docker run -v "$(pwd)":/code presidentbeef/brakeman --color -o brakeman_results.html | |
- name: Archive Brakeman results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: brakeman-results | |
path: brakeman_results.html | |
bundle_audit: | |
name: Bundler audit | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 # https://github.com/ruby/setup-ruby | |
with: | |
bundler-cache: true | |
ruby-version: 3.3.0 | |
- name: Install bundler-audit | |
run: | | |
gem install bundler-audit | |
- name: Run bundler-audit | |
run: | | |
bundler-audit check --update | |
test: | |
name: Tests | |
runs-on: ubuntu-22.04 | |
services: | |
postgres: | |
image: postgres:16 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: ["5432:5432"] | |
chrome: | |
image: browserless/chrome:latest | |
env: | |
PORT: 3333 | |
CONNECTION_TIMEOUT: -1 # No timeout | |
ports: ["3333:3333"] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install ruby dependencies | |
uses: ruby/setup-ruby@v1 # https://github.com/ruby/setup-ruby | |
with: | |
bundler-cache: true | |
ruby-version: 3.3.0 | |
- name: Update apt | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get update -qq -o Acquire::Retries=3 | |
- name: Install libvips | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get install --fix-missing -qq -o Acquire::Retires=3 libvips libwebp-dev | |
- name: Include node and yarn | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install JS dependencies | |
run: | | |
yarn install --pure-lockfile | |
- name: Setup databse | |
env: | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
RAILS_ENV: test | |
CI: true | |
run: | | |
bin/rails db:setup | |
- name: Build assets | |
run: | | |
yarn build:dev | |
yarn build:css | |
- name: Run tests | |
env: | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
RAILS_ENV: test | |
CI: true | |
CHROME_URL: http://localhost:3333 | |
run: | | |
bundle exec rspec --format documentation | |
- name: Archive screenshots | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: screenshots | |
path: tmp/capybara | |
# For debugging the build using upterm to ssh into the container comment in this step | |
# See https://github.com/marketplace/actions/debugging-with-ssh | |
# - name: debug | |
# uses: lhotari/action-upterm@v1 |