Bump rspec-rails from 7.1.0 to 7.1.1 in /web #838
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 | |
on: | |
pull_request: | |
push: | |
branches: [ main ] | |
defaults: | |
run: | |
working-directory: web | |
env: | |
GKE_PROJECT_ID: context-co | |
GKE_ZONE: us-central1 | |
GKE_CLUSTER_NAME: autopilot-cluster-1 | |
GRUF_SERVER_BINDING_URL: localhost:50052 | |
GRUF_DEFAULT_CLIENT_HOST: localhost:8081 | |
TAILSCALE_HOSTNAME: "github-ci-runner-${{ github.run_id }}" | |
RUN_TAILSCALE_AS: sudo | |
jobs: | |
scan_ruby: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
working-directory: web | |
- name: Scan for common Rails security vulnerabilities using static analysis | |
run: bin/brakeman --no-pager | |
scan_js: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
working-directory: web | |
- name: Scan for security vulnerabilities in JavaScript dependencies | |
run: bin/importmap audit | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
working-directory: web | |
- name: Lint code for consistent style | |
run: bin/rubocop -f github | |
test: | |
runs-on: runs-on,runner=16cpu-linux-x64,run-id=${{ github.run_id }} | |
timeout-minutes: 15 | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 | |
# redis: | |
# image: redis | |
# ports: | |
# - 6379:6379 | |
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
- name: Install packages | |
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips postgresql-client | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: web/sidecar/go.mod | |
cache-dependency-path: web/sidecar/go.sum | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
working-directory: web | |
- name: Tailscale | |
uses: tailscale/github-action@v3 | |
with: | |
oauth-client-id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TAILSCALE_OAUTH_SECRET }} | |
tags: tag:ci | |
hostname: ${{ env.TAILSCALE_HOSTNAME }} | |
args: "--ssh" | |
statedir: /tmp/tailscale | |
- name: Allow SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA2R380bKZPq/2xqbCQY0uruH8qLpDQdQBkvVqlflpOX" >> ~/.ssh/authorized_keys | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/authorized_keys | |
- name: Figure out the username | |
run: whoami | |
- name: Build sidecar | |
run: go build | |
working-directory: web/sidecar | |
- name: Run tests | |
env: | |
RAILS_ENV: test | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432 | |
SHEPHERD_AGENT_API_ENDPOINT: "https://${{ env.TAILSCALE_HOSTNAME }}.barbel-bramble.ts.net" | |
# REDIS_URL: redis://localhost:6379/0 | |
run: | | |
./bin/test & | |
bundle exec rails db:test:prepare spec | |
- name: Keep screenshots from failed system tests | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: screenshots | |
path: ${{ github.workspace }}/tmp/screenshots | |
if-no-files-found: ignore |