chorus/.github/workflows/rust.yml

41 lines
968 B
YAML
Raw Normal View History

2023-04-04 16:43:53 +02:00
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
2023-04-04 17:48:33 +02:00
build_and_test:
2023-04-04 16:43:53 +02:00
runs-on: ubuntu-latest
steps:
2023-04-15 17:47:24 +02:00
- uses: actions/checkout@v3
2023-04-15 17:26:44 +02:00
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git python3 build-essential
2023-04-15 17:47:24 +02:00
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
2023-04-15 17:44:58 +02:00
- name: Prepare and start spacebarchat-server
2023-04-15 17:26:44 +02:00
run: |
2023-04-15 17:44:58 +02:00
npm install
npm run setup
2023-04-15 17:26:44 +02:00
npm run start &
echo $! > server_pid.txt
2023-04-15 17:47:24 +02:00
working-directory: ./spacebarchat-server
2023-04-04 16:43:53 +02:00
- name: Build
run: cargo build --verbose
2023-04-04 17:42:41 +02:00
- name: Run tests
run: cargo test --verbose
2023-04-15 17:26:44 +02:00
- name: Terminate the server
run: |
kill $(cat server_pid.txt)
rm server_pid.txt