add orchestra page #2658
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: test | |
on: | |
pull_request: | |
branches: ["*"] | |
push: | |
branches: [main] | |
concurrency: ci-${{ github.ref }} | |
env: | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
RAILS_ENV: test | |
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/app | |
REDIS_URL: redis://127.0.0.1:6379 | |
RSPEC_RETRY_RETRY_COUNT: 3 | |
ELASTICSEARCH_URL: 127.0.0.1:9200 | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler: default | |
bundler-cache: true | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Lint Ruby | |
run: bundle exec rubocop | |
- name: Lint Api | |
run: yarn lint | |
# - name: Lint Native App | |
# add this once we are ready to lint the native app | |
# run: cd native && yarn lint | |
build: | |
name: Test | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: app | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
redis: | |
image: redis:latest | |
ports: | |
- 6379:6379 | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0 | |
ports: | |
- 9200:9200 | |
options: >- | |
-e "discovery.type=single-node" | |
-e "xpack.security.enabled=false" | |
env: | |
ES_JAVA_OPTS: -Xms512m -Xmx512m | |
volumes: | |
- elasticsearch:/usr/share/elasticsearch/data | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout LFS objects | |
run: git lfs pull --include "test/**,spec/**,app/assets/**" | |
- name: Install Vips | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libvips42 | |
- name: Install ffmpeg | |
run: sudo apt-get install --no-install-recommends -y ffmpeg | |
- name: Install audiowaveform | |
run: | | |
sudo add-apt-repository -y ppa:chris-needham/ppa | |
sudo apt-get update | |
sudo apt-get install -y audiowaveform | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install yarn | |
run: yarn install && cd native && yarn install | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Create PG Database | |
run: bundle exec rake db:create db:migrate | |
- name: Check Model Annotations | |
run: bundle exec annotate --models && bin/git_tracked_are_unmodified | |
- name: Generate GraphQL Types | |
run: yarn graphql:types && cd native && yarn graphql:types | |
- name: Install Playwright Browsers | |
run: npx --yes playwright install --with-deps chromium | |
- name: Build and test with Rake | |
run: bundle exec rspec --format documentation | |
- name: Run tests | |
run: | | |
bin/rails test | |
bin/rails test:system | |
- name: Scan for security vulnerabilities | |
run: bin/brakeman |