-
Notifications
You must be signed in to change notification settings - Fork 25
45 lines (37 loc) · 1.36 KB
/
main.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
name: Main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
features: [""]
runs-on: "ubuntu-latest"
container: rust:1.82
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build ${{ matrix.features }}
test:
strategy:
matrix:
features: [""]
runs-on: "ubuntu-latest"
container: rust:1.82
services:
consul:
image: consul:1.11.11
env:
# We pass the config as a JSON here to simulate one service with 3 nodes.
# TODO: Ideally, we should use the same setup in local environment (`testdata/config.hcl`) in GHA test.
CONSUL_LOCAL_CONFIG: '{"acl": [{"default_policy": "allow", "enable_token_persistence": true, "enabled": true}], "services": [ {"address": "1.1.1.1", "checks": [], "id": "test-service-1", "name": "test-service", "port": 20001, "tags": ["first"]}, {"address": "2.2.2.2", "checks": [], "id": "test-service-2", "name": "test-service", "port": 20002, "tags": ["second"]}, {"address": "3.3.3.3", "checks": [], "id": "test-service-3", "name": "test-service", "port": 20003, "tags": ["third"]} ]}'
env:
CONSUL_HTTP_ADDR: http://consul:8500
steps:
- uses: actions/checkout@v2
- name: Test
run: cargo test ${{ matrix.features }}