Skip to content

Develop

Develop #127

Workflow file for this run

name: "Build-Master-Branch"
on:
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master
- develop
env:
app_name: Fancy Mumble
RUSTFLAGS: "-Dwarnings"
jobs:
# kani:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - uses: awalsh128/cache-apt-pkgs-action@latest
# with:
# packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev
# version: 1.0
# - name: Install Protoc
# uses: arduino/setup-protoc@v1
# - name: Kani run
# uses: model-checking/[email protected]
# with:
# working-directory: src-tauri
# args: --tests
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev
version: 1.0
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: "Install tests"
working-directory: src-tauri
run: |
rustup component add clippy
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: "Run clippy"
working-directory: src-tauri
run: |
cargo clippy --no-default-features --all-targets -- -W clippy::pedantic -W clippy::nursery -W clippy::unwrap_used -D warnings
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev
version: 1.0
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: "Run tests"
working-directory: src-tauri
run: |
cargo test --no-default-features
build-app:
needs:
- clippy
- tests
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [ubuntu-20.04, windows-latest] # macos-latest is currently not working
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev
- name: Install vcpkg (windows only)
if: matrix.platform == 'windows-latest'
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: "${{ github.workspace }}/vcpkg"
vcpkgGitCommitId: "c8696863d371ab7f46e213d8f5ca923c4aef2a00"
vcpkgGitUrl: "https://github.com/microsoft/vcpkg.git"
env:
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
- name: workaround for nasm.us's potato pc (windows only)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: |
# Define URLs
$urlToCheck = "https://nasm.us/"
$fileToDownload = "https://github.com/microsoft/vcpkg/files/12073957/nasm-2.16.01-win64.zip"
# Define download location
$downloadFolder = Join-Path -Path $env:VCPKG_ROOT -ChildPath "downloads"
# Check if website is available
try {
$response = Invoke-WebRequest -Uri $urlToCheck -Method Head -ErrorAction Stop
if ($response.StatusCode -ne 200) {
throw
}
Write-Host "$urlToCheck is available."
}
catch {
Write-Host "$urlToCheck is not available. Downloading file..."
# Create download folder if it doesn't exist
if (!(Test-Path -Path $downloadFolder)) {
New-Item -ItemType Directory -Path $downloadFolder
}
# Download file
$filePath = Join-Path -Path $downloadFolder -ChildPath (Split-Path -Path $fileToDownload -Leaf)
Invoke-WebRequest -Uri $fileToDownload -OutFile $filePath
Write-Host "File downloaded to $filePath."
}
- name: Install dependencies (windows only)
if: matrix.platform == 'windows-latest'
run: |
vcpkg install openssl:x64-windows
vcpkg install openssl:x64-windows-static
vcpkg integrate install
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: "yarn"
- name: Install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: yarn install # Change this to npm, yarn or pnpm.
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: "Set environmental variables (Windows)"
if: matrix.platform == 'windows-latest'
run: |
echo "OPENSSL_DIR=$env:VCPKG_ROOT\installed\x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}