52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: memind_adm CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: memind-adm-ci-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
verify:
|
|
name: Test, build, and release script checks
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- name: Check out exact commit
|
|
run: |
|
|
git init .
|
|
git remote add origin https://git.tkmind.cn/tkmind/memind_adm.git
|
|
git fetch --depth=2 origin "${{ gitea.sha }}"
|
|
git checkout --detach FETCH_HEAD
|
|
test "$(git rev-parse HEAD)" = "${{ gitea.sha }}"
|
|
|
|
- name: Install locked dependencies
|
|
run: npm ci --no-audit --no-fund
|
|
|
|
- name: Check patch formatting
|
|
run: git diff --check HEAD^ HEAD
|
|
|
|
- name: Run Admin API tests
|
|
run: npm test
|
|
|
|
- name: Build production frontend
|
|
run: VITE_BASE_PATH=/ops npm run build
|
|
|
|
- name: Check release scripts
|
|
run: |
|
|
bash -n scripts/release-prod.sh
|
|
bash -n scripts/check-gray-ready.sh
|
|
bash -n scripts/deploy-gray-103.sh
|
|
|
|
- name: Confirm build leaves the worktree clean
|
|
run: test -z "$(git status --porcelain=v1 --untracked-files=all)"
|