Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

J-HowHuang is testing out GitHub Actions πŸš€ #3

J-HowHuang is testing out GitHub Actions πŸš€

J-HowHuang is testing out GitHub Actions πŸš€ #3

name: Server Integration Test
run-name: ${{ github.actor }} is testing out GitHub Actions πŸš€
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
volumes:
- ${{ github.workspace }}/tests/test_s3_files:/usr/share/nginx/html
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup BATS testing framework
uses: mig4/[email protected]
- name: setup-redis-1
uses: shogo82148/actions-setup-redis@v1
with:
redis-port: 6379
redis-conf: redis.conf
- name: setup-redis-2
uses: shogo82148/actions-setup-redis@v1
with:
redis-port: 6380
redis-conf: redis.conf
- name: setup-redis-3
uses: shogo82148/actions-setup-redis@v1
with:
redis-port: 6381
redis-conf: redis.conf
- name: Create redis cluster
run: redis-cli --cluster create localhost:6379 localhost:6380 localhost:6381 --cluster-replicas 0
- 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 tests/server-integration.bats