Merge pull request 'CI: build branches through their pull request only' (#69) from ci-triggers into main
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 46s
CI / Lint (eslint) (push) Successful in 47s
CI / Security (npm audit) (push) Successful in 44s
CI / Integration (api) (push) Successful in 2m49s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m24s
CI / UI (playwright) (push) Successful in 2m42s
CI / Deploy (push) Successful in 13s
CI / Deploy worker (push) Successful in 6s
CI / Notify (push) Successful in 3s
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 46s
CI / Lint (eslint) (push) Successful in 47s
CI / Security (npm audit) (push) Successful in 44s
CI / Integration (api) (push) Successful in 2m49s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m24s
CI / UI (playwright) (push) Successful in 2m42s
CI / Deploy (push) Successful in 13s
CI / Deploy worker (push) Successful in 6s
CI / Notify (push) Successful in 3s
This commit was merged in pull request #69.
This commit is contained in:
commit
7a01c28e06
3 files changed
+22
-6
No files matched your search
@@ -3,9 +3,12 @@ name: CI
|
||||
# One pipeline: lint, unit tests, audit, scans, integration and UI tests must all pass before main deploys (#45).
|
||||
# Actions are pinned to full commit SHAs (version in the trailing comment).
|
||||
|
||||
# Pushes build only main (which deploys); branches are built through their pull
|
||||
# request. Building both pushes and pull requests of a branch ran every job twice and
|
||||
# doubled the runner queue.
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: ["**"]
|
||||
schedule:
|
||||
|
||||
@@ -596,9 +596,10 @@ Everything runs from `.gitea/workflows/ci.yml`:
|
||||
| `Deploy` | Calls the `pulse-deploy` webhook on CT 122, waits until `/healthz` reports the tested commit, then tags it `deploy-*` | Push to `main`, only after all six checks pass |
|
||||
| `Notify` | Matrix alert on any failure on `main` or in the weekly audit, and on every deploy | As needed |
|
||||
|
||||
Branch protection on `main` requires `CI / Lint (eslint) (push)`, `CI / Test (jest) (push)`,
|
||||
`CI / Security (npm audit) (push)`, `CI / Scan (secrets, workflows, shell) (push)`,
|
||||
`CI / Integration (api) (push)` and `CI / UI (playwright) (push)`. Actions are pinned to commit
|
||||
Branch protection on `main` requires `CI / Lint (eslint) (pull_request)`, `CI / Test (jest) (pull_request)`,
|
||||
`CI / Security (npm audit) (pull_request)`, `CI / Scan (secrets, workflows, shell) (pull_request)`,
|
||||
`CI / Integration (api) (pull_request)` and `CI / UI (playwright) (pull_request)` (branches are only
|
||||
built through their pull request; pushes build `main`). Actions are pinned to commit
|
||||
SHAs, container images to digests, checkouts don't keep the token, and builds use `npm ci`. The plan for the rest of the pipeline is tracked in #45.
|
||||
|
||||
### Integration tests
|
||||
|
||||
+14
-2
@@ -6,8 +6,20 @@
|
||||
set -euo pipefail
|
||||
: "${DB_NAME:?}" "${DB_USER:?}" "${DB_PASSWORD:?}"
|
||||
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends mariadb-server >/dev/null
|
||||
# The Playwright image points apt at Azure's Ubuntu mirror, which our runner can't
|
||||
# always reach; use the main Ubuntu mirror instead, and retry transient failures.
|
||||
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
|
||||
[ -f "$f" ] && sed -i 's#http://azure\.archive\.ubuntu\.com/#http://archive.ubuntu.com/#g' "$f"
|
||||
done
|
||||
for attempt in 1 2 3; do
|
||||
if apt-get -o Acquire::Retries=3 update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 install -y -qq --no-install-recommends mariadb-server >/dev/null; then
|
||||
break
|
||||
fi
|
||||
[ "$attempt" = 3 ] && { echo "::error::could not install mariadb-server"; exit 1; }
|
||||
echo "apt failed (attempt $attempt); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
mkdir -p /run/mysqld && chown mysql:mysql /run/mysqld
|
||||
if ! mariadb-admin ping --silent 2>/dev/null; then
|
||||
(mariadbd --user=mysql --bind-address=127.0.0.1 --port=3306 >/tmp/mariadb.log 2>&1 &)
|
||||
|
||||
Reference in new issue
Block a user