Feature: Automatic backup after playing a game #673
Workflow file for this run
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
on: | |
- push | |
- pull_request | |
name: Main | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
rust-target: x86_64-pc-windows-msvc | |
artifact-name: win64 | |
artifact-file: ludusavi.exe | |
- os: windows-latest | |
rust-target: i686-pc-windows-msvc | |
artifact-name: win32 | |
artifact-file: ludusavi.exe | |
- os: ubuntu-20.04 | |
rust-target: x86_64-unknown-linux-gnu | |
artifact-name: linux | |
artifact-file: ludusavi | |
- os: macos-latest | |
rust-target: x86_64-apple-darwin | |
artifact-name: mac | |
artifact-file: ludusavi | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: mtkennerly/dunamai-action@v1 | |
with: | |
env-var: LUDUSAVI_VERSION | |
args: --style semver | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable-${{ matrix.rust-target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.os }}-${{ matrix.rust-target }} | |
- if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: sudo apt-get update && sudo apt-get install -y gcc libxcb-composite0-dev | |
- run: cargo build --release | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: ludusavi-v${{ env.LUDUSAVI_VERSION }}-${{ matrix.artifact-name }} | |
path: target/release/${{ matrix.artifact-file }} | |
test: | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.os }} | |
- if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: sudo apt-get update && sudo apt-get install -y gcc libxcb-composite0-dev | |
- if: ${{ matrix.os == 'windows-latest' }} | |
run: reg import tests/ludusavi.reg | |
- if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
cd tests/root3/game5 && cmd /c "mklink /J data-symlink data" | |
- if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
cd tests/root3/game5 && ln -s data data-symlink | |
- run: cargo test | |
lint: | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.os }} | |
- run: cargo fmt --all -- --check | |
- run: cargo clippy --workspace -- --deny warnings |