-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from sm64js/MMO_benchmark_rust
Rust server
- Loading branch information
Showing
26 changed files
with
5,302 additions
and
1,361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/node_modules | ||
/dist | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
on: | ||
push: | ||
paths: | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
pull_request: | ||
paths: | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
|
||
name: Rust Server Audit | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
name: Install Toolchain | ||
with: | ||
profile: minimal | ||
toolchain: nightly-2020-10-23 | ||
override: true | ||
|
||
- uses: actions-rs/cargo@v1 | ||
name: Install Cargo Tools | ||
with: | ||
command: install | ||
args: cargo-audit | ||
|
||
- uses: actions-rs/cargo@v1 | ||
name: Audit | ||
with: | ||
command: audit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
on: [push, pull_request] | ||
|
||
name: Rust Server Test & Publish | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
# TODO run Rust stuff conditionally | ||
# push: | ||
# paths: | ||
# - "rust-server/**/*" | ||
# - ".github/workflows/test-and-publish.yml" | ||
# pull_request: | ||
# paths: | ||
# - "rust-server/**/*" | ||
# - ".github/workflows/test-and-publish.yml" | ||
|
||
env: | ||
RUST_BACKTRACE: full | ||
RUSTC_WRAPPER: sccache | ||
SCCACHE_CACHE_SIZE: 500M | ||
SCCACHE_DIR: /home/runner/.cache/sccache | ||
SCCACHE_IDLE_TIMEOUT: 0 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
name: Install Toolchain | ||
with: | ||
profile: minimal | ||
toolchain: nightly-2020-10-23 | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
/home/runner/.cache/sccache | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install sccache | ||
env: | ||
LINK: https://github.com/mozilla/sccache/releases/download | ||
SCCACHE_VERSION: 0.2.13 | ||
run: | | ||
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl | ||
mkdir -p $HOME/.local/bin | ||
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz | ||
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Start sccache server | ||
run: | | ||
sccache --start-server | ||
- uses: actions-rs/cargo@v1 | ||
name: Check | ||
with: | ||
command: check | ||
|
||
# TODO needs tests | ||
# - uses: actions-rs/cargo@v1 | ||
# name: Test | ||
# with: | ||
# command: test | ||
|
||
- uses: actions-rs/cargo@v1 | ||
name: Fmt | ||
with: | ||
command: fmt | ||
args: -- --check | ||
|
||
- uses: actions-rs/cargo@v1 | ||
name: Clippy | ||
with: | ||
command: clippy | ||
args: -- -D warnings | ||
|
||
publish: | ||
# this needs to be changed, if the Rust server should be published from a different branch | ||
if: github.ref == 'refs/heads/MMO_benchmark_rust' | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
/home/runner/.cache/sccache | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup cache | ||
run: | | ||
mkdir sccache | ||
sudo mount -o bind /home/runner/.cache/sccache sccache | ||
- name: Deploy to Docker Hub | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: bash publish-rust-server.sh | ||
continue-on-error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.