Skip to content

refactor(apply): apply community migration redisign (#266) #857

refactor(apply): apply community migration redisign (#266)

refactor(apply): apply community migration redisign (#266) #857

Workflow file for this run

name: CI
on:
push:
branches: [dev]
pull_request:
branches: [master, dev]
jobs:
e2e-test:
name: e2e test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: groupher_server_ci
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
# - name: (Backend) checkout codebase
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# repository: 'groupher/groupher_server'
# path: 'backend_server'
# - name: (Backend) install libtinfo5
# run: sudo apt install libtinfo5
# - name: (Backend) Setup Elixir and OTP
# uses: actions/setup-elixir@v1
# with:
# elixir-version: '1.10.3'
# otp-version: '22.3'
# experimental-otp: true
# - name: (Backend) Restore dependencies cache
# uses: actions/cache@v2
# with:
# path: deps
# key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
# restore-keys: ${{ runner.os }}-mix-
# - name: (Backend) Checkout dev branch
# working-directory: ./backend_server
# run: git checkout debug-github-action-for-fe
# - name: (Backend) Install Packages
# working-directory: ./backend_server
# run: mix deps.get > /dev/null
# - name: (Backend) run migration
# working-directory: ./backend_server
# run: MIX_ENV=ci MIX_ENV=ci mix ecto.migrate > /dev/null
# - name: (Backend) set up test DB
# working-directory: ./backend_server
# run: MIX_ENV=ci mix ecto.setup > /dev/null
# - name: (Backend) seed data into DB
# working-directory: ./backend_server
# run: MIX_ENV=ci mix run priv/mock/cps_seeds.exs > /dev/null
# - name: (Backend) Run Server
# working-directory: ./backend_server
# run: MIX_ENV=ci mix phx.server &
- name: (Frontend) checkout codebase
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: "groupher/groupher_web"
path: "./"
- name: (Frontend) setup node env
uses: actions/setup-node@v2
with:
node-version: "20.3.1"
- name: (Frontend) Install Packages
working-directory: ./
run: npm install --legacy-peer-deps
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup Biome
# uses: biomejs/setup-biome@v1
# with:
# version: 1.4.1
- name: Run Biome
run: node_modules/.bin/biome lint src/**/*.{ts,tsx}
- name: (Frontend) Setup Config CMD Tools
working-directory: ./
run: ls -llh; chmod +x ./utils/bin/jq-linux; ./utils/bin/jq-linux -s '.[0] * .[1]' config/config.json config/config.ci.json > /tmp/config.json; cp /tmp/config.json ./config/config.json
- name: (Frontend) Build Project
working-directory: ./
run: npm run build.ci
- name: cache next.js build
uses: actions/cache@v3
with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
# - name: (Frontend) Run e2e Tests
# working-directory: ./frontend_server
# run: npm run test:ci
# - name: (Frontend) Cypress run
# uses: cypress-io/github-action@v2
# with:
# working-directory: ./frontend_server
# # build: npm run build
# start: npm run ci
# wait-on: http://localhost:3000