Disable LTO for Android builds (#18) #73
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: Template CI | |
on: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: '--codegen=debuginfo=0 --deny=warnings' | |
RUSTDOCFLAGS: '--deny=warnings' | |
CARGO_TERM_COLOR: always | |
ZNG_TP_LICENSES: false | |
jobs: | |
check-template: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: install cargo zng | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-zng | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo do version --verbose | |
- run: cargo do fmt --check | |
- run: cargo do check | |
- run: cargo clean | |
check-new: | |
needs: check-template | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: template | |
- uses: dtolnay/rust-toolchain@stable | |
- name: install cargo-about | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-about | |
- name: install cargo-zng | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-zng | |
git: https://github.com/zng-ui/zng | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo zng new | |
# /?/ to test that the name is cleaned | |
run: cargo zng new --template ./template -s"app=Test App /?/" -s"org=Test Org /?/" -s"qualifier=test" | |
- run: cargo check | |
working-directory: ./test-app | |
pack-ubuntu: | |
needs: check-new | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: template | |
fetch-depth: 0 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: install cargo-about | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-about | |
- name: install cargo-zng | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-zng | |
git: https://github.com/zng-ui/zng | |
- run: sudo apt-get install -y help2man | |
- run: sudo apt-get install -y desktop-file-utils | |
- run: sudo apt-get install -y lintian | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo zng new | |
run: cargo zng new --template ./template -s"app=Test App /?/" -s"org=Test Org /?/" -s"qualifier=test" | |
- name: git config | |
working-directory: ./test-app | |
run: | | |
git config user.name "Test User" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m test | |
- run: cargo do pack portable | |
working-directory: ./test-app | |
- run: cargo do pack portable-tar | |
working-directory: ./test-app | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: portable-ubuntu.tar.gz | |
path: ./test-app/target/pack/portable-tar/test-app.tar.gz | |
- run: cargo do pack deb | |
working-directory: ./test-app | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: test-app.deb | |
path: ./test-app/target/pack/deb/test-app.deb | |
pack-windows: | |
needs: check-new | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: template | |
- uses: dtolnay/rust-toolchain@stable | |
- name: install cargo-about | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-about | |
- name: install cargo-zng | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-zng | |
git: https://github.com/zng-ui/zng | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo zng new | |
run: cargo zng new --template ./template -s"app=Test App /?/" -s"org=Test Org /?/" -s"qualifier=test" | |
- run: cargo do pack portable | |
working-directory: ./test-app | |
- run: cargo do pack portable-tar | |
working-directory: ./test-app | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: portable-windows.tar.gz | |
path: ./test-app/target/pack/portable-tar/test-app.tar.gz | |
- run: cargo do pack windows | |
working-directory: ./test-app | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: test-app-0.1.0.exe | |
path: ./test-app/target/pack/windows/test-app-0.1.0.exe | |
pack-macos: | |
needs: check-new | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: template | |
- uses: dtolnay/rust-toolchain@stable | |
- name: install cargo-about | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-about | |
- name: install cargo-zng | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-zng | |
git: https://github.com/zng-ui/zng | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo zng new | |
run: cargo zng new --template ./template -s"app=Test App /?/" -s"org=Test Org /?/" -s"qualifier=test" | |
- run: cargo do pack portable | |
working-directory: ./test-app | |
- run: cargo do pack portable-tar | |
working-directory: ./test-app | |
- run: cargo do pack macos | |
working-directory: ./test-app | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: test-app.dmg | |
path: ./test-app/target/pack/macos/test-app.dmg | |
pack-android: | |
needs: check-new | |
# macos runner is faster (zng ci tests ubuntu, windows) | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: template | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: aarch64-linux-android, armv7-linux-androideabi | |
- name: install cargo-about | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-about | |
- name: install cargo-ndk | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-ndk | |
- name: install cargo-zng | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-zng | |
git: https://github.com/zng-ui/zng | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo zng new | |
run: cargo zng new --template ./template -s"app=Test App /?/" -s"org=Test Org /?/" -s"qualifier=test" | |
- run: cargo do pack android | |
working-directory: ./test-app | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: test-app.apk | |
path: ./test-app/target/pack/android/test-app.apk | |
test-all: | |
needs: [pack-ubuntu, pack-macos, pack-windows, pack-android] | |
runs-on: ubuntu-latest | |
steps: | |
- run: exit 0 |