0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00
logto/.github/workflows/main.yml

158 lines
3.5 KiB
YAML
Raw Normal View History

name: Main
on:
2022-06-22 18:55:58 +08:00
push:
2022-07-01 20:33:08 +08:00
branches:
- master
- 'push-action/**'
2022-06-27 16:38:39 +08:00
pull_request:
concurrency:
2022-07-01 21:33:25 +08:00
group: main-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
main-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v2
- name: Build
2022-05-18 10:58:01 +08:00
run: pnpm ci:build
main-lint:
2022-12-12 13:43:23 +08:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v2
- name: Prepack
run: pnpm prepack
- name: Lint
2022-05-18 10:58:01 +08:00
run: pnpm ci:lint
- name: Stylelint
2022-05-18 10:58:01 +08:00
run: pnpm ci:stylelint
main-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v2
2022-12-12 21:52:17 +08:00
- name: Build for test
run: pnpm -r build:test
- name: Test
2022-05-18 10:58:01 +08:00
run: pnpm ci:test
- name: Codecov core
uses: codecov/codecov-action@v3
with:
flags: core
directory: ./packages/core
- name: Codecov ui
uses: codecov/codecov-action@v3
with:
flags: ui
directory: ./packages/ui
main-dockerize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
context: .
2022-12-30 10:50:56 +08:00
main-alteration:
2022-12-30 10:50:56 +08:00
runs-on: ubuntu-latest
steps:
# ** Checkout fresh and alteration ref **
2022-12-30 10:50:56 +08:00
- uses: actions/checkout@v3
with:
fetch-depth: 2
path: ./fresh
- uses: actions/checkout@v3
with:
ref: v1.0.0-beta.11
path: ./alteration
# ** End **
- name: Copy lockfile # Make setup workflow happy
run: cp ./fresh/pnpm-lock.yaml ./
2022-12-30 10:50:56 +08:00
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v2
with:
run-install: false
# ** Prepack packages **
- name: Prepack fresh
working-directory: ./fresh
run: pnpm i && pnpm prepack
- name: Prepack alteration
working-directory: ./alteration
run: pnpm i && pnpm prepack
# ** End **
2022-12-30 10:50:56 +08:00
- name: Check alteration sequence
working-directory: ./fresh
2022-12-30 10:50:56 +08:00
run: node .scripts/check-alterations-sequence.js
- name: Setup Postgres
uses: ikalnytskyi/action-setup-postgres@v4
# ** Setup up-to-date databases and compare (test `up`) **
- name: Setup fresh database
working-directory: ./fresh
run: pnpm cli db seed
env:
DB_URL: postgres://postgres:postgres@localhost:5432/fresh
- name: Setup alteration database
working-directory: ./alteration
run: |
cd packages/cli
pnpm start db seed
env:
DB_URL: postgres://postgres:postgres@localhost:5432/alteration
- name: Run alteration scripts
working-directory: ./fresh
run: pnpm cli db alt deploy next
env:
DB_URL: postgres://postgres:postgres@localhost:5432/alteration
- name: Compare manifests
working-directory: ./fresh
run: node .scripts/compare-database.js fresh alteration
# ** End **
# ** Setup old databases and compare (test `down`) **
# TBD
# ** End **