chorus/.github/workflows/rust.yml

41 lines
968 B
YAML

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git python3 build-essential
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
git clone https://github.com/polyphony-chat/spacebarchat-server.git
- name: Prepare and start spacebarchat-server
run: |
npm install
npm run setup
npm run start &
echo $! > server_pid.txt
working-directory: ./spacebarchat-server
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Terminate the server
run: |
kill $(cat server_pid.txt)
rm server_pid.txt