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

Commit

Permalink
update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
J-HowHuang committed Mar 31, 2024
1 parent 6323c6c commit a6fe3f8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 43 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/server-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,49 @@ on:
branches:
- 'main'
- 'cp2-server*'
- 'rust-integration-test'
pull_request:
branches:
- 'main'
env:
CARGO_TERM_COLOR: always

jobs:
build:
coverage:
defaults:
run:
shell: bash
working-directory: ./server
runs-on: ubuntu-latest
env:
TEST_ROOT: ${{ github.workspace }}/server/tests
SERVER_ROOT: ${{ github.workspace }}/server
runs-on: self-hosted
continue-on-error: false

steps:
- uses: actions/checkout@v4
- name: Setup BATS testing framework
uses: mig4/[email protected]
- uses: actions/checkout@v3
- name: Install Toolchain
run: rustup update stable && rustup default stable && rustup component add rustfmt
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run mock S3 server
run: docker run -p 6333:80 -v ${{ github.workspace }}/server/tests/test_s3_files:/usr/share/nginx/html -d nginx
- 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
run: ${{ github.workspace }}/server/tests/test_setup_redis.sh
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --codecov --output-path lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: lcov.info
retention-days: 3
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
token: be8874e2-10d6-434f-9d52-db6094de31d6
files: lcov.info
name: codecov-umbrella # optional
fail_ci_if_error: true
verbose: true
19 changes: 0 additions & 19 deletions server/tests/server-integration.bats

This file was deleted.

File renamed without changes.

0 comments on commit a6fe3f8

Please sign in to comment.