fmt #35
Workflow file for this run
This file contains hidden or 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: Dioxus Builds | |
on: [push, pull_request, workflow_dispatch] | |
permissions: | |
contents: write | |
env: | |
RUSTFLAGS: -D warnings | |
RUSTDOCFLAGS: -D warnings | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgtk-3-dev \ | |
libwebkit2gtk-4.0-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev \ | |
libjavascriptcoregtk-4.0-dev \ | |
libsoup2.4-dev \ | |
libglib2.0-dev \ | |
libatk1.0-dev \ | |
libpango1.0-dev \ | |
libcairo2-dev \ | |
libgdk-pixbuf2.0-dev \ | |
libwayland-dev \ | |
libxkbcommon-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all-features | |
check_wasm: | |
name: Check wasm32 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all-features --lib --target wasm32-unknown-unknown | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgtk-3-dev \ | |
libwebkit2gtk-4.0-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev \ | |
libjavascriptcoregtk-4.0-dev \ | |
libsoup2.4-dev \ | |
libglib2.0-dev \ | |
libatk1.0-dev \ | |
libpango1.0-dev \ | |
libcairo2-dev \ | |
libgdk-pixbuf2.0-dev \ | |
libwayland-dev \ | |
libxkbcommon-dev \ | |
libxcb-render0-dev \ | |
libxcb-shape0-dev \ | |
libxcb-xfixes0-dev \ | |
libssl-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --lib | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgtk-3-dev \ | |
libwebkit2gtk-4.0-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev \ | |
libjavascriptcoregtk-4.0-dev \ | |
libsoup2.4-dev \ | |
libglib2.0-dev \ | |
libatk1.0-dev \ | |
libpango1.0-dev \ | |
libcairo2-dev \ | |
libgdk-pixbuf2.0-dev \ | |
libwayland-dev \ | |
libxkbcommon-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings | |
dioxus_build: | |
name: Dioxus Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
TARGET: web | |
- os: ubuntu-latest | |
TARGET: desktop | |
- os: macos-latest | |
TARGET: desktop | |
- os: windows-latest | |
TARGET: desktop | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- name: Install dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgtk-3-dev \ | |
libwebkit2gtk-4.0-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev \ | |
libjavascriptcoregtk-4.0-dev \ | |
libsoup2.4-dev \ | |
libglib2.0-dev \ | |
libatk1.0-dev \ | |
libpango1.0-dev \ | |
libcairo2-dev \ | |
libgdk-pixbuf2.0-dev \ | |
libwayland-dev \ | |
libxkbcommon-dev | |
- name: Install Dioxus CLI | |
run: cargo install dioxus-cli | |
- name: Build for ${{ matrix.TARGET }} | |
run: dx build --release --platform ${{ matrix.TARGET }} | |
- name: Rename and package | |
shell: bash | |
run: | | |
if [ "${{ matrix.TARGET }}" = "web" ]; then | |
tar -czvf mylife-web.tar.gz dist | |
elif [ "${{ matrix.OS }}" = "windows-latest" ]; then | |
mv target/release/mylife.exe mylife-windows.exe | |
elif [ "${{ matrix.OS }}" = "macos-latest" ]; then | |
mv target/release/mylife mylife-macos | |
else | |
mv target/release/mylife mylife-linux | |
fi | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: mylife-${{ matrix.TARGET }}-${{ matrix.os }} | |
path: | | |
mylife-* | |
*.tar.gz | |
- uses: svenstaro/upload-release-action@v2 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: mylife-* | |
file_glob: true | |
tag: ${{ github.ref }} | |
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
overwrite: true |