Skip to content
This repository was archived by the owner on Jun 5, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build and Test
uses: actions-rs/tarpaulin@v0.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Backend
backend/target/
backend/watch-target/
backend/*-target/
backend/.sled/
backend/tarpaulin-report.html

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Image based on https://shaneutt.com/blog/rust-fast-small-docker-image-builds/

# Backend-Builder
FROM rust:latest as be-builder
FROM rust:1.50-slim as be-builder
WORKDIR /usr/src/secret_clan
COPY backend/Cargo.lock Cargo.lock
COPY backend/Cargo.toml Cargo.toml
Expand Down
28 changes: 20 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
watch-fe:
cd frontend && npm run watch

watch-be:
cd backend && LOG_LEVEL=info cargo watch -x 'run --target-dir watch-target' -w 'src' -c -i 'src/model/proto'

test-be:
cd backend && cargo tarpaulin --out Html --exclude-files src/model/proto/*
cd backend && cargo tarpaulin --out Html --exclude-files src/model/proto/* --target-dir test-target

bench:
cd backend && cargo bench

build-fe:
cd frontend && npm run build

build-be:
cd backend && cargo build

build:
DOCKER_BUILDKIT=1 docker build -t secret_clan .
DOCKER_BUILDKIT=1 docker build -t floric/neuland .

lint-fe:
cd frontend && npm run lint
lint-be:
cd backend && cargo clippy
lint:
lint-be
line-fe

run:
docker run --rm -it -p 3333:3333 secret_clan
docker run --rm -it -p 3333:3333 floric/neuland

release:
docker push floric/neuland

protoc:
proto:
protoc --proto_path=./schema message.proto --plugin=./frontend/node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=env=browser --ts_proto_opt=useOptionals=true --ts_proto_opt=oneof=unions --ts_proto_out=./frontend/src/types/proto message.proto
protoc --proto_path=./schema --rust_out=./backend/src/model/proto message.proto
protoc --proto_path=./schema --rust_out=./backend/src/model/proto message.proto
protoc --proto_path=./schema --rust_out=./backend/src/model/proto game.proto
protoc --proto_path=./schema --rust_out=./backend/src/model/proto player.proto
protoc --proto_path=./schema --rust_out=./backend/src/model/proto card.proto
protoc --proto_path=./schema --rust_out=./backend/src/model/proto task.proto
114 changes: 38 additions & 76 deletions backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading