diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..56eff4a --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,51 @@ +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)" diff --git a/scripts/.releaseignore-prod b/scripts/.releaseignore-prod index 8f8c222..4f0f3b3 100644 --- a/scripts/.releaseignore-prod +++ b/scripts/.releaseignore-prod @@ -1,4 +1,5 @@ .git +.gitea .gitignore .DS_Store .env