|
1 | | -name: Apps / Pty Proxy |
| 1 | +name: Apps / Relay |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
5 | 5 | branches: ["*"] |
6 | 6 | paths: |
7 | | - - apps/pty-proxy/** |
8 | | - - packages/db/** |
9 | | - - packages/logger/** |
10 | | - - packages/job-dispatch/** |
11 | | - - packages/auth/** |
12 | | - - packages/validators/** |
13 | | - - .github/workflows/apps-pty-proxy.yaml |
14 | | - - pnpm-lock.yaml |
| 7 | + - apps/relay/** |
| 8 | + - .github/workflows/apps-relay.yaml |
15 | 9 | push: |
16 | 10 | branches: ["main"] |
17 | 11 | paths: |
18 | | - - apps/pty-proxy/** |
19 | | - - packages/db/** |
20 | | - - packages/logger/** |
21 | | - - packages/job-dispatch/** |
22 | | - - packages/validators/** |
23 | | - - packages/auth/** |
24 | | - - .github/workflows/apps-pty-proxy.yaml |
25 | | - - pnpm-lock.yaml |
| 12 | + - apps/relay/** |
| 13 | + - .github/workflows/apps-relay.yaml |
26 | 14 |
|
27 | 15 | jobs: |
| 16 | + tests: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + contents: read |
| 20 | + pull-requests: write |
| 21 | + defaults: |
| 22 | + run: |
| 23 | + working-directory: apps/relay |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout code |
| 27 | + uses: actions/checkout@v3 |
| 28 | + |
| 29 | + - name: Set up Go |
| 30 | + uses: actions/setup-go@v4 |
| 31 | + with: |
| 32 | + go-version: "1.25" |
| 33 | + |
| 34 | + - name: Cache Go modules |
| 35 | + uses: actions/cache@v3 |
| 36 | + with: |
| 37 | + path: | |
| 38 | + ~/.cache/go-build |
| 39 | + ~/go/pkg/mod |
| 40 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 41 | + restore-keys: | |
| 42 | + ${{ runner.os }}-go- |
| 43 | +
|
| 44 | + - name: Install dependencies |
| 45 | + run: go mod download |
| 46 | + |
| 47 | + - name: Run tests with coverage |
| 48 | + run: go test -race ./... |
| 49 | + |
28 | 50 | build: |
29 | 51 | runs-on: ubuntu-latest |
30 | 52 |
|
|
36 | 58 | matrix: |
37 | 59 | platform: [linux/amd64] |
38 | 60 |
|
| 61 | + defaults: |
| 62 | + run: |
| 63 | + working-directory: apps/relay |
| 64 | + |
39 | 65 | steps: |
40 | 66 | - uses: actions/checkout@v4 |
41 | 67 |
|
@@ -64,24 +90,26 @@ jobs: |
64 | 90 | id: meta |
65 | 91 | uses: docker/metadata-action@v4 |
66 | 92 | with: |
67 | | - images: ctrlplane/pty-proxy |
| 93 | + images: ctrlplane/relay |
68 | 94 | tags: | |
69 | 95 | type=sha,format=short,prefix= |
70 | 96 |
|
71 | 97 | - name: Build |
72 | 98 | uses: docker/build-push-action@v6 |
73 | 99 | if: github.ref != 'refs/heads/main' |
74 | 100 | with: |
| 101 | + context: apps/relay |
75 | 102 | push: false |
76 | | - file: apps/pty-proxy/Dockerfile |
| 103 | + file: apps/relay/Dockerfile |
77 | 104 | platforms: ${{ matrix.platform }} |
78 | 105 | tags: ${{ steps.meta.outputs.tags }} |
79 | 106 |
|
80 | 107 | - name: Build and Push |
81 | 108 | uses: docker/build-push-action@v6 |
82 | 109 | if: github.ref == 'refs/heads/main' && env.DOCKERHUB_LOGIN == 'true' |
83 | 110 | with: |
| 111 | + context: apps/relay |
84 | 112 | push: true |
85 | | - file: apps/pty-proxy/Dockerfile |
| 113 | + file: apps/relay/Dockerfile |
86 | 114 | platforms: ${{ matrix.platform }} |
87 | 115 | tags: ${{ steps.meta.outputs.tags }} |
0 commit comments