-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (134 loc) · 4.45 KB
/
test.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
149
150
151
152
153
154
155
on:
push:
branches:
- main
pull_request: {}
name: Test
jobs:
# format:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Install Rust toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# components: rustfmt
# override: true
# - name: Verify versions
# run: rustc --version && rustup --version && cargo --version
# - name: Check code style
# run: cargo fmt -- --check
# smoke-test:
# needs: format
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Install Rust toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - name: Verify versions
# run: rustc --version && rustup --version && cargo --version
# - name: Cache build context
# id: cache-cargo
# uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/registry
# ~/.cargo/git
# target
# key: ${{ runner.os }}-cargo
# - name: Install SQLite3
# run: sudo apt-get update && sudo apt-get install -y sqlite3
# - name: Test code
# run: cargo test
integration-test:
# needs: smoke-test
runs-on: ubuntu-latest
env:
PROSE_POD_SERVER_DIR: ${{ github.workspace }}/server
# For the API we don't use a subfolder just to make things easier.
PROSE_POD_API_DIR: ${{ github.workspace }}
PROSE_POD_SYSTEM_DIR: ${{ github.workspace }}/system
steps:
# NOTE: We **must** checkout `prose-pod-api` first otherwise checking it out
# silently deletes the other checked out repositories.
- name: Checkout prose-pod-api
uses: actions/checkout@v4
with:
path: ${{ env.PROSE_POD_API_DIR }}
submodules: true
- name: Checkout prose-pod-server
uses: actions/checkout@v4
with:
repository: prose-im/prose-pod-server
path: ${{ env.PROSE_POD_SERVER_DIR }}
submodules: true
- name: Checkout prose-pod-system
uses: actions/checkout@v4
with:
repository: prose-im/prose-pod-system
path: ${{ env.PROSE_POD_SYSTEM_DIR }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Verify versions
run: rustc --version && rustup --version && cargo --version
- name: Cache build context
id: cache-cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo
# NOTE: Recommended by [the Task documentation](https://taskfile.dev/installation/#github-actions).
- name: Install Task
uses: arduino/setup-task@v2
# SEE: https://github.com/cross-rs/cross/wiki/Getting-Started#installing-cross-1
- name: Install `cross`
run: cargo install cross
- name: Build images
run: scripts/run-locally/build-images
- name: Install SQLite3
run: sudo apt-get update && sudo apt-get install -y sqlite3
# Install our fork of Step CI (has more features we need).
# - name: Install Step CI
# run: npm install -g stepci
- name: Checkout stepci-runner
uses: actions/checkout@v4
with:
repository: RemiBardon/stepci-runner
ref: prose
path: ${{ github.workspace }}/stepci-runner
- name: Build stepci-runner
run: |
cd "${{ github.workspace }}/stepci-runner"
npm install
npm run build
npm link
- name: Checkout stepci
uses: actions/checkout@v4
with:
repository: RemiBardon/stepci
ref: prose
path: ${{ github.workspace }}/stepci
- name: Build & install stepci
run: |
cd "${{ github.workspace }}/stepci"
# NOTE: `npm install` must be ran **before** `npm link @stepci/runner`
# otherwise the link doesn't work properly and `stepci` fails at runtime
# because of missing fixes from our branch.
npm install
npm link @stepci/runner
npm run build
npm install -g .
- name: Run integration tests
run: task integration-test