This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
try solve buggy service container volume bound #46
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
name: Server Integration Test | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'cp2-server*' | |
pull_request: | |
branches: | |
- 'main' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./server | |
services: | |
mocks3: | |
image: nginx | |
ports: | |
- 6333:80 | |
options: -v ${{ github.workspace }}/data:/usr/share/nginx/html | |
runs-on: ubuntu-latest | |
env: | |
TEST_ROOT: ${{ github.workspace }}/server/tests | |
SERVER_ROOT: ${{ github.workspace }}/server | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup BATS testing framework | |
uses: mig4/[email protected] | |
- name: Move mock S3 data | |
run: cp -r ${{ github.workspace }}/server/tests/test_s3_files/. ${{ github.workspace }}/data | |
- name: setup-redis | |
uses: shogo82148/actions-setup-redis@v1 | |
with: | |
auto-start: false | |
- name: start redis nodes | |
run: redis-server ${{ github.workspace }}/server/redis.conf --port 6379 --cluster-config-file node1.conf& | |
- name: start redis nodes | |
run: redis-server ${{ github.workspace }}/server/redis.conf --port 6380 --cluster-config-file node2.conf& | |
- name: start redis nodes | |
run: redis-server ${{ github.workspace }}/server/redis.conf --port 6381 --cluster-config-file node3.conf& | |
- name: Create redis cluster | |
run: redis-cli --cluster create localhost:6379 localhost:6380 localhost:6381 --cluster-replicas 0 --cluster-yes | |
- name: Build | |
run: cargo build --verbose | |
- name: Run | |
run: | | |
REDIS_PORT=6379 cargo run & | |
REDIS_PORT=6380 cargo run & | |
REDIS_PORT=6381 cargo run & | |
- name: Test get file | |
run: bats ${{ github.workspace }}/server/tests/server-integration.bats |