Skip to content

Commit

Permalink
ci: Reimplement real world ci tests (#593)
Browse files Browse the repository at this point in the history
* ci: Reimplement real world ci tests

* name steps

* rust cache and debug mode

* relative distPath and iconPath

* delete __tests__ folder [skip ci]
  • Loading branch information
FabianLars authored Oct 27, 2023
1 parent 802a179 commit 4807db0
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 3,846 deletions.
77 changes: 57 additions & 20 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,97 @@
name: 'test-action'
name: 'real world tests'

on:
workflow_dispatch:
pull_request:
push:
branches:
- dev

jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
settings:
- platform: 'macos-latest'
args: '--target universal-apple-darwin'
- platform: 'ubuntu-latest'
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
runs-on: ${{ matrix.settings.platform }}
steps:
- uses: actions/checkout@v4

# node
- name: install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x

- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

# example-with-tauri tests the auto installation of the tauri cli
- name: install example dependencies
run: pnpm install
working-directory: ./__fixtures__/example

# rust
- name: install Rust stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: install pnpm
uses: pnpm/action-setup@v2
targets: aarch64-apple-darwin

- uses: Swatinem/rust-cache@v2
with:
version: 8.x.x
cache-on-failure: true
workspaces: |
./__fixtures__/example/src-tauri
./__fixtures__/example-with-tauri/src-tauri
# system
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
if: matrix.settings.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: install example dependencies
run: pnpm install
working-directory: ./packages/action/__fixtures__/example
- uses: ./
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev
- name: Preconfigured Tauri Project
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Updater signature is exposed here to make sure it works in PR's
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
with:
projectPath: ./packages/action/__fixtures__/example-with-tauri
projectPath: ./__fixtures__/example-with-tauri
includeDebug: true
includeRelease: false
tagName: example-with-tauri-v__VERSION__
releaseName: 'Release example with preconfigured Tauri app v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
- uses: ./
args: ${{ matrix.settings.args }}

- name: Frontend-only Project
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Updater signature is exposed here to make sure it works in PR's
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
with:
projectPath: ./packages/action/__fixtures__/example
projectPath: ./__fixtures__/example
distPath: ../dist # relative to tauri.conf.json
iconPath: ./icon.png # relative to projectPath
bundleIdentifier: com.tauri.actiontest
# iconPath: ./icon.png
includeDebug: true
includeRelease: false
tagName: example-v__VERSION__
releaseName: 'Release example app v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.settings.args }}
Loading

0 comments on commit 4807db0

Please sign in to comment.