Skip to content

Commit

Permalink
Merge branch 'main' into show-diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda authored Nov 14, 2024
2 parents 5f97300 + e4903e2 commit 9999897
Show file tree
Hide file tree
Showing 326 changed files with 12,714 additions and 4,841 deletions.
87 changes: 87 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
version: 2.1

workflows:
version: 2.1
build:
jobs:
- build_and_test
orbs:
browser-tools: circleci/[email protected]
jobs:
build_and_test:
working_directory: ~/cfp_app
docker:
- image: cimg/ruby:3.1.2-browsers
environment:
PGHOST: localhost
PGUSER: cfp_app
RAILS_ENV: test
- image: postgres:12.5
environment:
POSTGRES_USER: cfp_app
POSTGRES_DB: cfp_app_test
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- browser-tools/install-browser-tools
- checkout
- run: |
ruby --version
node --version
java --version
google-chrome --version
- run: gem install bundler
- run: yarn install

# Restore Cached gem Dependencies
- restore_cache:
keys:
- cfp_app-gems-{{ checksum "Gemfile.lock" }}
- cfp_app-gems-
# Restore Cached node module Dependencies
- restore_cache:
keys:
- cfp_app-packages-{{ checksum "yarn.lock" }}
- cfp_app-packages-

# Bundle install dependencies
- run: bundle config set path 'vendor/bundle'
- run: bundle install

## Cache Dependencies

# Generate this fallback cache first because the most recent match
# will be used even if there is a more precise match
- save_cache:
key: cfp_app-gems-
paths:
- vendor/bundle
# Generate a cache for this exact Gemfile.lock
- save_cache:
key: cfp_app-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# Generate a fallback cache of node packages
- save_cache:
key: cfp_app-packages-
paths:
- node_modules
# Generate a cache for this exact yarn.lock
- save_cache:
key: cfp_app-packages-{{ checksum "yarn.lock" }}
paths:
- node_modules

# Wait for DB
- run: dockerize -wait tcp://localhost:5432 -timeout 1m

# Setup the database
- run: bundle exec rake db:setup

# Run the tests
- run: bin/rake

# Store failed js spec artifacts
- store_artifacts:
path: tmp/screenshots
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "bundler" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Title

Reason for Change
=================
*

Changes
=======
*

Minor
=====
*

https://link.to/task_tracker_card
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "cfp-next-staging" #Must be unique in Heroku
heroku_email: "[email protected]"
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

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

steps:
- run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libvips postgresql-client libpq-dev

- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- uses: actions/setup-node@v4
with:
node-version: '15.14.0'

- name: Run tests
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres@localhost:5432/cfp_app_test
run: bin/rails db:setup assets:precompile spec

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/capybara
if-no-files-found: ignore
Loading

0 comments on commit 9999897

Please sign in to comment.