Repository navigation
104 lines (93 loc) · 3.84 KB
/
Copy pathpull-request.yml
File metadata and controls
104 lines (93 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Pull Request
on:
pull_request:
branches: [main, canary, AgentHits-Dev]
# deps-auto-update.yml starts the checks of its branch this way: a push with
# GITHUB_TOKEN creates no pull_request event.
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pull-request-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
audit:
name: audit and typecheck
# Only the owner's own PRs reach the Mac mini runners. A fork PR could rewrite
# this line, so the repo also requires approval for every outside contributor.
runs-on: ${{ (github.event.pull_request.user.login == github.repository_owner && github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "dokploy-ci"]') || 'ubuntu-24.04' }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.4
- run: bun audit --audit-level=moderate
- uses: actions/setup-node@v7
if: ${{ !cancelled() }}
with:
node-version: 26.13.0
- run: bun install --frozen-lockfile
if: ${{ !cancelled() }}
- run: bun run server:build
if: ${{ !cancelled() }}
- run: bun run typecheck
if: ${{ !cancelled() }}
pr-check:
runs-on: ${{ (github.event.pull_request.user.login == github.repository_owner && github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted", "dokploy-ci"]') || 'ubuntu-24.04' }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
job: [build, test]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.4
- uses: actions/setup-node@v7
with:
node-version: 26.13.0
- name: Install Nixpacks
if: matrix.job == 'test' && runner.environment == 'github-hosted'
run: |
export NIXPACKS_VERSION=1.41.0
curl -sSL https://nixpacks.com/install.sh | bash
echo "Nixpacks installed $NIXPACKS_VERSION"
- name: Install Railpack
if: matrix.job == 'test' && runner.environment == 'github-hosted'
run: |
export RAILPACK_VERSION=0.42.0
curl -sSL https://railpack.com/install.sh | bash
echo "Railpack installed $RAILPACK_VERSION"
- name: Add build tools to PATH
if: matrix.job == 'test'
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Initialize Docker Swarm
if: matrix.job == 'test'
run: |
# The Mac mini keeps its swarm between runs.
if [ "$(docker info --format '{{.Swarm.LocalNodeState}}')" != "active" ]; then
docker swarm init
fi
docker network create --driver overlay dokploy-network || true
echo "✅ Docker Swarm initialized"
- run: bun install --frozen-lockfile
- run: bun run server:build
- run: bun run ${{ matrix.job }}
env:
# The fork's db module throws without a password in production, and the Next build imports it.
POSTGRES_PASSWORD: ${{ matrix.job == 'build' && 'build-time-postgres-password' || '' }}
# Tests remove their swarm services, but a cancelled or timed-out run skips
# that. Docker is shared by all Mac mini runners, so only this checkout's
# apps go (see CHECKOUT_ID in application.real.test.ts).
- name: Remove leftover real-test services
if: always() && matrix.job == 'test'
working-directory: apps/dokploy
run: |
id="$(printf %s "$PWD" | shasum -a 256 | cut -c1-8)"
docker service ls --format '{{.Name}}' | grep -E "^real-[a-z]+-${id}" | xargs -r docker service rm