@@ -8,33 +8,33 @@ name: check
8
8
9
9
jobs :
10
10
check :
11
- runs-on : ubuntu-latest
12
- defaults :
13
- run :
14
- shell : bash
15
11
strategy :
16
12
matrix :
17
13
mq : [standalone, rabbitmq, redis]
14
+ ci_image : [ubuntu-latest, macos-latest]
18
15
include :
19
16
- mq : rabbitmq
20
17
docker_image : " rabbitmq:3.8-management"
21
- mq_uri : " amqp://guest:guest@localhost "
22
- mq_api : " http://guest:guest@localhost :15672/api"
18
+ mq_uri : " amqp://guest:guest@127.0.0.1 "
19
+ mq_api : " http://guest:guest@127.0.0.1 :15672/api"
23
20
- mq : redis
24
21
docker_image : " redis"
25
- mq_uri : " redis://localhost:16379"
26
- services :
27
- mq :
28
- image : ${{ matrix.docker_image }}
29
- ports :
30
- - 5672:5672 # rabbitmq
31
- - 15672:15672 # rabbitmq
32
- - 16379:6379 # redis
33
- redis : # for storage macro
34
- image : redis
35
- ports :
36
- - 6379:6379
22
+ mq_uri : " redis://127.0.0.1:16379"
23
+ runs-on : ${{ matrix.ci_image }}
24
+ defaults :
25
+ run :
26
+ shell : bash
37
27
steps :
28
+ - name : Install docker
29
+ if : ${{ startsWith(matrix.ci_image, 'macos') }}
30
+ run : |
31
+ brew install docker
32
+ colima start
33
+ - name : Start container (mq)
34
+ if : ${{ matrix.mq != 'standalone' }}
35
+ run : docker run -d -p 5672:5672 -p 15672:15672 -p 16379:6379 ${{ matrix.docker_image }}
36
+ - name : Start container (redis) # for storage macro
37
+ run : docker run -d -p 6379:6379 redis
38
38
- name : Checkout
39
39
uses : actions/checkout@v3
40
40
with :
@@ -45,12 +45,15 @@ jobs:
45
45
toolchain : stable
46
46
components : rustfmt, clippy
47
47
- name : Check
48
+ if : ${{ startsWith(matrix.ci_image, 'ubuntu') }} # skip check in macos because it is slow
48
49
run : cargo check --release
49
50
- name : Build
50
51
run : cargo build --all-targets
51
52
- name : Format check
53
+ if : ${{ startsWith(matrix.ci_image, 'ubuntu') }}
52
54
run : cargo fmt --all -- --check
53
55
- name : Clippy test
56
+ if : ${{ startsWith(matrix.ci_image, 'ubuntu') }}
54
57
run : cargo clippy --profile test -- -D warnings -D clippy::dbg_macro
55
58
- name : Download Server
56
59
run : bash download-server.sh
0 commit comments