optional feature storage_macro_dbc, add get_jwt #216
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
name: check | |
jobs: | |
check: | |
strategy: | |
matrix: | |
mq: [standalone, rabbitmq, redis] | |
ci_image: [ubuntu-latest, macos-latest] | |
include: | |
- mq: rabbitmq | |
docker_image: "rabbitmq:3.8-management" | |
mq_uri: "amqp:https://guest:[email protected]" | |
mq_api: "http:https://guest:[email protected]:15672/api" | |
- mq: redis | |
docker_image: "redis" | |
mq_uri: "redis:https://127.0.0.1:16379" | |
runs-on: ${{ matrix.ci_image }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Install docker | |
if: ${{ startsWith(matrix.ci_image, 'macos') }} | |
run: | | |
brew install docker | |
colima start | |
- name: Start container (MySQL) | |
run: | | |
docker run --name mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=test_db -p 3306:3306 -d mysql:8.0 | |
MYSQL_HOST="127.0.0.1" | |
echo "MYSQL_DATABASE_URL=mysql:https://root:password@${MYSQL_HOST}:3306/test_db" >> $GITHUB_ENV | |
- name: Start container (mq) | |
if: ${{ matrix.mq != 'standalone' }} | |
run: docker run -d -p 5672:5672 -p 15672:15672 -p 16379:6379 ${{ matrix.docker_image }} | |
- name: Start container (redis) # for storage macro | |
run: docker run -d -p 6379:6379 redis | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Check | |
if: ${{ startsWith(matrix.ci_image, 'ubuntu') }} # skip check in macos because it is slow | |
run: cargo check --release | |
- name: Build | |
run: cargo build --all-targets | |
- name: Format check | |
if: ${{ startsWith(matrix.ci_image, 'ubuntu') }} | |
run: cargo fmt --all -- --check | |
- name: Clippy test | |
if: ${{ startsWith(matrix.ci_image, 'ubuntu') }} | |
run: cargo clippy --profile test -- -D warnings -D clippy::dbg_macro | |
- name: Download Server | |
run: bash download-server.sh | |
working-directory: tests | |
- name: Run tests | |
if: ${{ matrix.mq != 'standalone' }} | |
env: | |
COLINK_SERVER_MQ_URI: ${{ matrix.mq_uri }} | |
COLINK_SERVER_MQ_API: ${{ matrix.mq_api }} | |
run: cargo test --features="storage_macro_dbc" | |
- name: Run tests (standalone) | |
if: ${{ matrix.mq == 'standalone' }} | |
run: cargo test --features="storage_macro_dbc" |