@@ -8,33 +8,33 @@ name: check
88
99jobs :
1010 check :
11- runs-on : ubuntu-latest
12- defaults :
13- run :
14- shell : bash
1511 strategy :
1612 matrix :
1713 mq : [standalone, rabbitmq, redis]
14+ ci_image : [ubuntu-latest, macos-latest]
1815 include :
1916 - mq : rabbitmq
2017 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"
2320 - mq : redis
2421 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
3727 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
3838 - name : Checkout
3939 uses : actions/checkout@v3
4040 with :
@@ -45,12 +45,15 @@ jobs:
4545 toolchain : stable
4646 components : rustfmt, clippy
4747 - name : Check
48+ if : ${{ startsWith(matrix.ci_image, 'ubuntu') }} # skip check in macos because it is slow
4849 run : cargo check --release
4950 - name : Build
5051 run : cargo build --all-targets
5152 - name : Format check
53+ if : ${{ startsWith(matrix.ci_image, 'ubuntu') }}
5254 run : cargo fmt --all -- --check
5355 - name : Clippy test
56+ if : ${{ startsWith(matrix.ci_image, 'ubuntu') }}
5457 run : cargo clippy --profile test -- -D warnings -D clippy::dbg_macro
5558 - name : Download Server
5659 run : bash download-server.sh
0 commit comments