gui: calculate queue time after receiving new Collection
#559
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
# This clippys, docs, tests, builds. | |
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: "full" | |
RUST_MIN_STACK: 8000000 | |
jobs: | |
# Run format separately. | |
# | |
# This will fast-cancel other CI early if this fails. | |
# | |
# `cargo fmt` checks _all_ code, regardless of the OS | |
# or any `#[cfg]`'s, so this only needs to run on Linux. | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Format | |
# FIXME: There is no `--ignore` yet, so `external/` prevents using `--all`. | |
run: cargo fmt --check --package festival-gui --package shukusai | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
pkg: [festival-gui] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ matrix.pkg }}-${{ matrix.os }} | |
- name: Install dependencies | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt update | |
sudo apt install -y libgtk-3-dev libasound2-dev libjack-dev libpulse-dev libfuse2 | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
rustup target add aarch64-apple-darwin | |
fi | |
shell: bash | |
- name: Rust Toolchain | |
if: matrix.os != 'macos-latest' | |
uses: dtolnay/[email protected] | |
with: | |
components: clippy, rust-src | |
targets: aarch64-apple-darwin | |
- name: Rust Toolchain (macOS) | |
if: matrix.os == 'macos-latest' | |
uses: dtolnay/[email protected] | |
with: | |
components: clippy, rust-src | |
targets: aarch64-apple-darwin | |
- name: Clippy | |
run: cargo clippy --release --package ${{ matrix.pkg }} | |
- name: Test | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
cargo test --release --package shukusai --package ${{ matrix.pkg }} --jobs 1 | |
else | |
cargo test --release --package shukusai --package ${{ matrix.pkg }} | |
fi | |
- name: Build | |
shell: bash | |
run: | | |
# ARM builds. | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
cargo build --release --package ${{ matrix.pkg }} --target aarch64-apple-darwin | |
fi | |
cargo build --release --package ${{ matrix.pkg }} | |
- name: Compress (GUI) | |
shell: bash | |
run: | | |
mkdir OUTPUT | |
VERSION=$(grep -m1 "version" gui/Cargo.toml | grep -o "[0-9].[0-9].[0-9]") | |
DOCS=$(grep -m1 "title" gui/mdbook/book.toml | grep -o "[0-9].[0-9].[0-9]") | |
if [ "$VERSION" != "$DOCS" ]; then | |
echo "CARGO $VERSION != DOCS TITLE $DOCS" | |
exit 1 | |
fi | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
# AppImage | |
utils/mk_appimage.sh | |
mv utils/"Festival-v${VERSION}-x86_64.AppImage" OUTPUT/ | |
# Tar | |
cp assets/images/icon/512.png target/release/festival.png | |
cp utils/Festival.AppDir/festival.desktop target/release/ | |
cp LICENSE target/release/ | |
cd target/release | |
tar -czpf "Festival-v${VERSION}-linux-x64.tar.gz" festival festival.png festival.desktop LICENSE | |
mv "Festival-v${VERSION}-linux-x64.tar.gz" ../../OUTPUT/ | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
# x64 | |
utils/mk_app.sh | |
utils/mk_dmg.sh "Festival-v${VERSION}-macos-x64" | |
mv utils/"Festival-v${VERSION}-macos-x64.dmg" OUTPUT/ | |
# ARM64 | |
mv target/aarch64-apple-darwin/release/festival target/release/ | |
utils/mk_app.sh | |
utils/mk_dmg.sh "Festival-v${VERSION}-macos-arm64" | |
mv utils/"Festival-v${VERSION}-macos-arm64.dmg" OUTPUT/ | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
# Zip | |
mv target/release/festival.exe target/release/Festival.exe | |
cd target/release | |
powershell Compress-Archive -LiteralPath Festival.exe -DestinationPath "Festival-v${VERSION}-windows-x64.zip" | |
mv "Festival-v${VERSION}-windows-x64.zip" ../../OUTPUT/ | |
fi | |
- name: Archive | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.pkg }}-${{ matrix.os }} | |
path: OUTPUT |