2023-06-19 16:21:53 +02:00
|
|
|
name: Build and Test
|
2023-04-04 16:43:53 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2023-06-19 16:21:53 +02:00
|
|
|
rust:
|
2023-04-04 16:43:53 +02:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
2023-08-25 21:07:16 +02:00
|
|
|
environment: CI
|
2023-04-04 16:43:53 +02:00
|
|
|
|
|
|
|
steps:
|
2023-07-14 11:58:12 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Clone spacebar server
|
2023-04-15 17:26:44 +02:00
|
|
|
run: |
|
2023-05-13 15:49:07 +02:00
|
|
|
git clone https://github.com/bitfl0wer/server.git
|
2023-07-14 11:58:12 +02:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-08-25 21:30:07 +02:00
|
|
|
node-version: 18
|
2023-07-14 11:58:12 +02:00
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: server/package-lock.json
|
2023-05-13 15:49:07 +02:00
|
|
|
- name: Prepare and start Spacebar 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 &
|
2023-05-13 15:49:07 +02:00
|
|
|
working-directory: ./server
|
2023-07-14 11:58:12 +02:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2023-08-26 13:32:35 +02:00
|
|
|
with:
|
|
|
|
cache-all-crates: "true"
|
2023-08-25 20:58:46 +02:00
|
|
|
- name: Build, Test and Publish Coverage
|
|
|
|
run: |
|
2023-08-26 13:45:44 +02:00
|
|
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
2023-08-26 13:48:15 +02:00
|
|
|
cargo binstall --no-confirm cargo-tarpaulin
|
2023-08-25 20:58:46 +02:00
|
|
|
cargo tarpaulin --all-features --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120
|