Leverage CliFileWriter to safely modify files during sync #1289
Workflow file for this run
This file contains hidden or 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: PR Checks | |
on: | |
- pull_request | |
permissions: | |
actions: none | |
attestations: none | |
checks: none | |
contents: read | |
deployments: none | |
id-token: none | |
issues: none | |
discussions: none | |
packages: read | |
pages: none | |
pull-requests: none | |
repository-projects: none | |
security-events: none | |
statuses: none | |
jobs: | |
uspec: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: psychic | |
POSTGRES_DB: psychic_core_test | |
POSTGRES_PASSWORD: 'postgres' | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis:6.2 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
env: | |
NODE_ENV: test | |
PORT: 7777 | |
DB_USER: psychic | |
DB_NAME: psychic_core_test | |
DB_HOST: localhost | |
DB_PASSWORD: postgres | |
DB_PORT: 5432 | |
TZ: UTC | |
GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
APP_ENCRYPTION_KEY: ${{ secrets.APP_ENCRYPTION_KEY }} | |
LEGACY_APP_ENCRYPTION_KEY: ${{ secrets.LEGACY_APP_ENCRYPTION_KEY }} | |
DREAM_PARALLEL_TESTS: 4 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: npm install -g corepack | |
- run: corepack enable | |
- run: "echo \"nodeLinker: node-modules\" > ./.yarnrc.yml" | |
- run: "echo -e \"npmScopes:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" rvohealth:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmAuthToken: '${{ secrets.GITHUB_TOKEN }}'\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmRegistryServer: 'https://npm.pkg.github.com'\" >> ./.yarnrc.yml" | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.yarn-cache | |
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: yarn list | |
- run: yarn install --immutable | |
- run: yarn psy db:migrate --skip-sync | |
- run: yarn uspec | |
fspec: | |
name: Feature tests | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: psychic | |
POSTGRES_DB: psychic_core_test | |
POSTGRES_PASSWORD: 'postgres' | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis:6.2 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
env: | |
NODE_ENV: test | |
PORT: 7777 | |
DB_USER: psychic | |
DB_NAME: psychic_core_test | |
DB_HOST: localhost | |
DB_PASSWORD: postgres | |
DB_PORT: 5432 | |
TZ: UTC | |
GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
APP_ENCRYPTION_KEY: ${{ secrets.APP_ENCRYPTION_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: "Check chrome and chromedriver are installed" | |
run: | | |
google-chrome --version | |
which google-chrome | |
chromedriver --version | |
which chromedriver | |
- run: npm install -g corepack | |
- run: corepack enable | |
- run: "echo \"nodeLinker: node-modules\" > ./.yarnrc.yml" | |
- run: "echo -e \"npmScopes:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" rvohealth:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmAuthToken: '${{ secrets.GITHUB_TOKEN }}'\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmRegistryServer: 'https://npm.pkg.github.com'\" >> ./.yarnrc.yml" | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.yarn-cache | |
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: yarn list | |
- run: yarn install --immutable | |
- name: install client packages | |
run: yarn install --immutable | |
working-directory: ./client | |
- name: install puppeteer browsers | |
run: yarn puppeteer browsers install firefox | |
- name: make screenshots dir | |
run: mkdir -p /tmp/screenshots | |
- name: run migrations | |
run: yarn psy db:migrate --skip-sync | |
- name: run feature specs | |
run: yarn fspec | |
- name: Archive screenshots | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: Feature spec screenshots | |
path: /tmp/screenshots | |
lint: | |
name: Linting | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: development | |
YARN_CACHE_FOLDER: ~/.yarn-cache | |
GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: npm install -g corepack | |
- run: corepack enable | |
- run: "echo \"nodeLinker: node-modules\" > ./.yarnrc.yml" | |
- run: "echo -e \"npmScopes:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" rvohealth:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmAuthToken: '${{ secrets.GITHUB_TOKEN }}'\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmRegistryServer: 'https://npm.pkg.github.com'\" >> ./.yarnrc.yml" | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.yarn-cache | |
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: yarn list | |
- run: yarn install --immutable | |
- run: yarn lint | |
check-build: | |
name: Check build | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: development | |
YARN_CACHE_FOLDER: ~/.yarn-cache | |
GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: npm install -g corepack | |
- run: corepack enable | |
- run: "echo \"nodeLinker: node-modules\" > ./.yarnrc.yml" | |
- run: "echo -e \"npmScopes:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" rvohealth:\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmAuthToken: '${{ secrets.GITHUB_TOKEN }}'\" >> ./.yarnrc.yml" | |
- run: "echo -e \" npmRegistryServer: 'https://npm.pkg.github.com'\" >> ./.yarnrc.yml" | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.yarn-cache | |
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: yarn list | |
- run: yarn install --immutable | |
- run: yarn build | |
- run: yarn build:test-app |