fix(driver-interface): requesting process modules sometimes fails due… #444
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
name: Rust | |
on: | |
push: | |
branches: ['master', 'release'] | |
pull_request: | |
branches: ['master'] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
rust-check: | |
name: Rust Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Check fmt | |
run: rustup component add rustfmt && cargo fmt --check | |
build-radar-web: | |
name: Radar Web Scripts | |
runs-on: ubuntu-latest | |
needs: [rust-check] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: 'yarn' | |
cache-dependency-path: | | |
radar/web/yarn.lock | |
- name: Run install | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install | |
dir: radar/web | |
- name: Build production bundle | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: build | |
dir: radar/web | |
env: | |
NODE_ENV: production | |
- uses: actions/upload-artifact@v4 | |
name: Upload | |
with: | |
name: radar-www | |
path: radar/web/dist | |
build-radar-server: | |
name: Radar Server (${{ matrix.build }}) | |
needs: [rust-check] | |
strategy: | |
matrix: | |
build: [linux] | |
include: | |
- build: linux | |
os: ubuntu-20.04 | |
target: radar-server-standalone | |
# https://github.com/clap-rs/clap/issues/1938#issuecomment-632186396 | |
flags: '' | |
# - build: windows | |
# os: windows-latest | |
# target: radar-server-standalone.exe | |
# flags: -Ctarget-feature=+crt-static | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Build | |
run: cargo build --verbose --release --bin radar-server-standalone | |
env: | |
RUSTFLAGS: ${{ matrix.flags }} | |
- uses: actions/upload-artifact@v4 | |
name: Upload radar server | |
with: | |
name: radar-server-${{ matrix.build }} | |
path: target/release/${{ matrix.target }} | |
docker-radar-server: | |
runs-on: ubuntu-latest | |
needs: [build-radar-server, build-radar-web] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/valthrun/cs2-radar-server | |
tags: | | |
type=ref,event=branch | |
type=sha | |
env: | |
DOCKER_METADATA_SHORT_SHA_LENGTH: 7 | |
- name: Download radar binary | |
uses: actions/download-artifact@v4 | |
with: | |
name: radar-server-linux | |
path: target/release/ | |
- name: Download radar scripts | |
uses: actions/download-artifact@v4 | |
with: | |
name: radar-www | |
path: radar/web/dist | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./docker/cs2-radar-server.dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-radar-client: | |
name: Radar Client | |
runs-on: windows-latest | |
needs: [rust-check] | |
steps: | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Get package version | |
shell: bash | |
run: | | |
VERSION=$(cargo pkgid --manifest-path radar/client-standalone/Cargo.toml | cut -d# -f2 | cut -d: -f2 | cut -d@ -f2) | |
echo "Package version: $VERSION" | |
echo "ARTIFACT_VERSION=$VERSION" >> "$GITHUB_ENV" | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Build | |
run: cargo build --verbose --release --bin radar-client-standalone | |
env: | |
RUSTFLAGS: -Ctarget-feature=+crt-static | |
- name: Upload release build to portal | |
shell: bash | |
run: .github/workflows/artifact_upload.sh cs2-radar-client target/release/radar-client-standalone.exe target/release/radar_client_standalone.pdb | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
ARTIFACT_API_KEY: ${{ secrets.ARTIFACT_API_KEY }} | |
build-overlay: | |
name: CS2 Overlay | |
runs-on: windows-latest | |
needs: [rust-check] | |
steps: | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Get package version | |
shell: bash | |
run: | | |
VERSION=$(cargo pkgid --manifest-path controller/Cargo.toml | cut -d# -f2 | cut -d: -f2) | |
echo "Package version: $VERSION" | |
echo "ARTIFACT_VERSION=$VERSION" >> "$GITHUB_ENV" | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Build | |
run: cargo build --verbose --release --bin controller | |
env: | |
RUSTFLAGS: -Ctarget-feature=+crt-static | |
# Right now there are no tests specified | |
# - name: Run tests | |
# run: cargo test --verbose | |
- name: Upload release build to portal | |
shell: bash | |
run: .github/workflows/artifact_upload.sh cs2-overlay target/release/controller.exe target/release/controller.pdb | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
ARTIFACT_API_KEY: ${{ secrets.ARTIFACT_API_KEY }} |