Mortal
This commit is contained in:
99
.github/workflows/docs.yml
vendored
Normal file
99
.github/workflows/docs.yml
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
name: deploy-docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .github/workflows/docs.yml
|
||||
- docs/**
|
||||
|
||||
env:
|
||||
CARGO_TARGET_DIR: ~/cargo-target-dir
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Environment preparation
|
||||
id: prep
|
||||
run: |
|
||||
set -x
|
||||
|
||||
rustup toolchain update --no-self-update stable
|
||||
rustup default stable
|
||||
rustup component add clippy rustfmt
|
||||
rustup show
|
||||
|
||||
rustc --version | awk '{print $2}' | tee RUSTC_VER
|
||||
echo "rustc_ver=$(cat RUSTC_VER)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get latest versions of mdbook with plugins
|
||||
id: get-version
|
||||
run: |
|
||||
set -x
|
||||
|
||||
curl -SsL https://crates.io/api/v1/crates/mdbook | jq -r .crate.max_stable_version | tee MDBOOK_VER
|
||||
curl -SsL https://crates.io/api/v1/crates/mdbook-admonish | jq -r .crate.max_stable_version | tee MDBOOK_ADMONISH_VER
|
||||
curl -SsL https://crates.io/api/v1/crates/mdbook-pagetoc | jq -r .crate.max_stable_version | tee MDBOOK_PAGETOC_VER
|
||||
echo "mdbook_ver=$(cat MDBOOK_VER)" >> $GITHUB_OUTPUT
|
||||
echo "mdbook_admonish_ver=$(cat MDBOOK_ADMONISH_VER)" >> $GITHUB_OUTPUT
|
||||
echo "mdbook_pagetoc_ver=$(cat MDBOOK_PAGETOC_VER)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache for mdbook
|
||||
id: cache-mdbook
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/bin/mdbook
|
||||
key: ${{ github.workflow }}|${{ runner.os }}|cargo|00|${{ steps.prep.outputs.rustc_ver }}|mdbook|${{ steps.get-version.outputs.mdbook_ver }}
|
||||
- name: Cache for mdbook-admonish
|
||||
id: cache-mdbook-admonish
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/bin/mdbook-admonish
|
||||
key: ${{ github.workflow }}|${{ runner.os }}|cargo|00|${{ steps.prep.outputs.rustc_ver }}|mdbook-admonish|${{ steps.get-version.outputs.mdbook_admonish_ver }}
|
||||
- name: Cache for mdbook-pagetoc
|
||||
id: cache-mdbook-pagetoc
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/bin/mdbook-pagetoc
|
||||
key: ${{ github.workflow }}|${{ runner.os }}|cargo|00|${{ steps.prep.outputs.rustc_ver }}|mdbook-pagetoc|${{ steps.get-version.outputs.mdbook_pagetoc_ver }}
|
||||
|
||||
- name: Install mdbook
|
||||
if: steps.cache-mdbook.outputs.cache-hit != 'true'
|
||||
run: cargo install mdbook --version ${{ steps.get-version.outputs.mdbook_ver }}
|
||||
- name: Install mdbook-admonish
|
||||
if: steps.cache-mdbook-admonish.outputs.cache-hit != 'true'
|
||||
run: cargo install mdbook-admonish --version ${{ steps.get-version.outputs.mdbook_admonish_ver }}
|
||||
- name: Install mdbook-pagetoc
|
||||
if: steps.cache-mdbook-pagetoc.outputs.cache-hit != 'true'
|
||||
run: cargo install mdbook-pagetoc --version ${{ steps.get-version.outputs.mdbook_pagetoc_ver }}
|
||||
|
||||
- name: Deploy GitHub Pages
|
||||
run: |
|
||||
set -x
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
|
||||
cd docs
|
||||
mdbook build
|
||||
|
||||
git branch gh-pages
|
||||
git worktree add gh-pages gh-pages
|
||||
git config user.name "GitHub Action"
|
||||
git config user.email "action@github.com"
|
||||
|
||||
cd gh-pages
|
||||
git update-ref -d refs/heads/gh-pages
|
||||
|
||||
mv .git ../dotgit
|
||||
find . -name . -o -prune -exec rm -rf -- {} +
|
||||
mv ../dotgit .git
|
||||
mv ../book/* .
|
||||
|
||||
git add .
|
||||
git commit -m "Deploy $GITHUB_SHA to gh-pages"
|
||||
git push -f -u origin gh-pages
|
||||
83
.github/workflows/libriichi.yml
vendored
Normal file
83
.github/workflows/libriichi.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
name: build-libriichi
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- .github/workflows/libriichi.yml
|
||||
- Cargo*
|
||||
- libriichi/**
|
||||
- exe-wrapper/**
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/libriichi.yml
|
||||
- Cargo*
|
||||
- libriichi/**
|
||||
- exe-wrapper/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
id: setup-python
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Run typos
|
||||
uses: crate-ci/typos@v1.18.0
|
||||
|
||||
- name: Environment preparation
|
||||
id: prep
|
||||
run: |
|
||||
set -x
|
||||
|
||||
rustup toolchain update --no-self-update stable
|
||||
rustup default stable
|
||||
rustup component add clippy rustfmt
|
||||
rustup show
|
||||
|
||||
rustc --version | awk '{print $2}' | tee RUSTC_VER
|
||||
echo "rustc_ver=$(cat RUSTC_VER)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache for Rust
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin
|
||||
~/.cargo/registry/index
|
||||
~/.cargo/registry/cache
|
||||
~/.cargo/git/db
|
||||
target
|
||||
key: ${{ github.workflow }}|${{ runner.os }}|cargo|00|${{ steps.prep.outputs.rustc_ver }}|${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ github.workflow }}|${{ runner.os }}|cargo|00|${{ steps.prep.outputs.rustc_ver }}|
|
||||
|
||||
- name: Run rustfmt
|
||||
run: cargo fmt --all --check
|
||||
|
||||
- name: Run clippy
|
||||
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cargo test --workspace --no-default-features --features flate2/zlib -- --nocapture
|
||||
cargo test --workspace --no-default-features --features flate2/zlib,sp_reproduce_cpp_ver -- --nocapture
|
||||
cargo test -p libriichi --no-default-features --benches
|
||||
|
||||
- name: Run build
|
||||
run: |
|
||||
cargo build -p libriichi --lib
|
||||
cargo build -p libriichi --bins --no-default-features
|
||||
cargo build -p exe-wrapper
|
||||
|
||||
- name: Check artifact
|
||||
run: |
|
||||
cd target/debug
|
||||
ldd libriichi.so stat validate_logs exe-wrapper
|
||||
python -c 'import libriichi'
|
||||
Reference in New Issue
Block a user