2023-05-30 14:30:22 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
RUST_BACKTRACE: "full"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-2019, macos-11, ubuntu-20.04]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo
|
|
|
|
target
|
2023-06-04 21:38:21 +00:00
|
|
|
key: ${{ matrix.os }}
|
2023-05-30 14:30:22 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y libgtk-3-dev
|
2023-06-04 14:38:12 +00:00
|
|
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
|
|
|
cargo install cargo-bundle
|
|
|
|
rustup target install aarch64-apple-darwin
|
2023-05-30 14:30:22 +00:00
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Test
|
2023-06-04 21:38:21 +00:00
|
|
|
run: cargo test --all-features --release
|
2023-05-30 14:30:22 +00:00
|
|
|
|
|
|
|
- name: Build
|
2023-06-04 14:38:12 +00:00
|
|
|
run: |
|
|
|
|
if [ "$RUNNER_OS" == "macOS" ]; then
|
2023-06-04 21:38:21 +00:00
|
|
|
cargo bundle --all-features --release
|
|
|
|
cargo bundle --all-features --release --target aarch64-apple-darwin
|
|
|
|
elif [ "$RUNNER_OS" == "Linux" ]; then
|
|
|
|
cargo build --all-features --release --target x86_64-unknown-linux-gnu
|
2023-06-04 14:38:12 +00:00
|
|
|
else
|
2023-06-04 21:38:21 +00:00
|
|
|
cargo build --all-features --release
|
2023-06-04 14:38:12 +00:00
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
|
2023-06-04 21:38:21 +00:00
|
|
|
- name: Archive (Windows)
|
|
|
|
if: ${{ runner.os == 'Windows' }}
|
2023-06-04 14:38:12 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-06-04 21:38:21 +00:00
|
|
|
name: windows
|
|
|
|
path: target/release/gupax.exe
|
2023-06-04 21:37:31 +00:00
|
|
|
|
2023-06-04 21:38:21 +00:00
|
|
|
- name: Archive (macOS-x64)
|
|
|
|
if: ${{ runner.os == 'macOS' }}
|
2023-06-04 21:37:31 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-06-04 21:38:21 +00:00
|
|
|
name: macos-x64
|
|
|
|
path: target/release/bundle/osx/Gupax.app
|
|
|
|
|
|
|
|
- name: Archive (macOS-arm64)
|
|
|
|
if: ${{ runner.os == 'macOS' }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: macos-arm64
|
|
|
|
path: target/aarch64-apple-darwin/release/bundle/osx/Gupax.app
|
|
|
|
|
|
|
|
- name: Archive (Linux)
|
|
|
|
if: ${{ runner.os == 'Linux' }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: linux
|
|
|
|
path: target/x86_64-unknown-linux-gnu/release/gupax
|