-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (139 loc) · 4.48 KB
/
application.yml
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Application
on: [push, pull_request]
jobs:
binary-build:
strategy:
matrix:
include:
- os: ubuntu
version: 22.04
goos: linux
- os: macOS
version: 12
goos: darwin
- os: windows
version: 2022
goos: windows
name: Binary Build (${{ matrix.os }} ${{ matrix.version }})
runs-on: ${{ matrix.os }}-${{ matrix.version }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: frontend/.nvmrc
- uses: actions/setup-go@v4
with:
go-version: 1.21.4
- name: Build frontend
run: |
cd frontend
npm ci
npm run build:prod
- name: Get the executable suffix
run: |
if [ "${{ matrix.goos }}" = "windows" ]; then
echo "SUFFIX=.exe" >> $GITHUB_ENV
fi
shell: bash
- name: Build binary for amd64
run: go build -o bin/remixdb-${{ matrix.goos }}-amd64${{ env.SUFFIX }} ./cmd/remixdb
env:
GOOS: ${{ matrix.goos }}
GOARCH: amd64
- name: Build binary for arm64
run: go build -o bin/remixdb-${{ matrix.goos }}-arm64${{ env.SUFFIX }} ./cmd/remixdb
env:
GOOS: ${{ matrix.goos }}
GOARCH: arm64
- name: Upload amd64 binary
uses: actions/upload-artifact@v4
with:
name: remixdb-${{ matrix.goos }}-amd64
path: bin/remixdb-${{ matrix.goos }}-amd64${{ env.SUFFIX }}
- name: Upload arm64 binary
uses: actions/upload-artifact@v4
with:
name: remixdb-${{ matrix.goos }}-arm64
path: bin/remixdb-${{ matrix.goos }}-arm64${{ env.SUFFIX }}
# Huge shoutout to https://github.com/orgs/community/discussions/26723#discussioncomment-3253091
# for the docker buildx caching solution.
docker-integration-test-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true
buildkitd-flags: --debug
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
push: false
tags: remixdb:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
outputs: type=docker,dest=/tmp/remixdb-image.tar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: remixdb-image
path: /tmp/remixdb-image.tar
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
generate-integration-tests:
runs-on: ubuntu-22.04
needs: docker-integration-test-build
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- run: python integration_tests/generate_matrix.py
id: matrix
integration-tests:
needs: generate-integration-tests
strategy:
max-parallel: 5
matrix: ${{ fromJson(needs.generate-integration-tests.outputs.matrix) }}
runs-on: ubuntu-22.04
name: Run integration tests (${{ matrix.name }}@${{ matrix.version }})
steps:
- uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: remixdb-image
path: /tmp
- name: Load Docker image
run: docker load -i /tmp/remixdb-image.tar
- uses: actions/cache@v3
with:
path: /tmp/integration-testing
key: ${{ matrix.name }}-${{ matrix.version }}-cache-${{ github.sha }}
restore-keys: |
${{ matrix.name }}-${{ matrix.version }}-cache-
# TODO: Start remixdb
- name: Run integration tests
run: |
cd integration_tests/${{ matrix.name }}
./run.sh
env:
VERSION: ${{ matrix.version }}