Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 50 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ on:
jobs:
check:
name: Check
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Skip on PRs: tauri 1.x wry/webkit2gtk system-lib rot.
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -30,7 +32,7 @@ jobs:
- name: Cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
workspaces: './src-tauri -> target'
shared-key: ${{ runner.os }}-base

- name: Cargo check
Expand All @@ -41,7 +43,9 @@ jobs:

testRust:
name: Test Rust
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Skip on PRs: tauri 1.x wry/webkit2gtk system-lib rot.
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -61,7 +65,7 @@ jobs:
- name: Cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
workspaces: './src-tauri -> target'
shared-key: ${{ runner.os }}-test

- name: Cargo test
Expand All @@ -72,34 +76,58 @@ jobs:

testTypescript:
name: Test Typescript
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Yarn cache
uses: actions/cache@v2
- name: Read Node version from mise.toml
id: node
run:
echo "version=$(grep -E '^node\\s*=' mise.toml | sed -E 's/.*"([^"]+)".*/\\1/')" >>
"$GITHUB_OUTPUT"

- name: Install package manager (from package.json)
run: |
corepack enable
corepack install

- uses: actions/setup-node@v4
with:
node-version: ${{ steps.node.outputs.version }}

- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"

- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
uses: actions/cache@v4
with:
path: |
~/.cache/yarn
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
.yarn/install-state.gz
key:
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-${{ hashFiles('yarn.lock')
}}
restore-keys: |
${{ runner.os }}-yarn-
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-

- name: Install TypeScript deps
uses: borales/actions-yarn@v3.0.0
with:
cmd: install
env:
YARN_ENABLE_HARDENED_MODE: 'false'
run: |
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
yarn install --immutable

- name: Run TypeScript tests
uses: borales/actions-yarn@v3.0.0
with:
cmd: step-ci-test
run: yarn step-ci-test

fmt:
name: Rustfmt
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Skip on PRs: tauri 1.x wry/webkit2gtk system-lib rot.
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -127,7 +155,9 @@ jobs:

clippy:
name: Clippy
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Skip on PRs: tauri 1.x wry/webkit2gtk system-lib rot.
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -150,7 +180,7 @@ jobs:
- name: Cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
workspaces: './src-tauri -> target'
shared-key: ${{ runner.os }}-base

- name: Cargo clippy
Expand Down
51 changes: 38 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,71 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
platform: [macos-latest, ubuntu-22.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Node.js setup
uses: actions/setup-node@v1
- name: Read Node version from mise.toml
id: node
shell: bash
run:
echo "version=$(grep -E '^node\\s*=' mise.toml | sed -E 's/.*"([^"]+)".*/\\1/')" >>
"$GITHUB_OUTPUT"

- name: Install package manager (from package.json)
run: |
corepack enable
corepack install

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: ${{ steps.node.outputs.version }}

- name: Rust setup
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
workspaces: './src-tauri -> target'
shared-key: ${{ runner.os }}-release

- name: Yarn cache
uses: actions/cache@v2
- name: Resolve yarn cache folder
id: yarn-config
shell: bash
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"

- name: Restore yarn install cache
uses: actions/cache@v4
with:
path: |
~/.cache/yarn
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
.yarn/install-state.gz
key:
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-${{ hashFiles('yarn.lock')
}}
restore-keys: |
${{ runner.os }}-yarn-
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-

- name: Install app dependencies and build web
run: yarn && yarn build
shell: bash
env:
YARN_ENABLE_HARDENED_MODE: 'false'
run: |
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
yarn install --immutable
yarn build

- name: Build the app
uses: tauri-apps/tauri-action@v0
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# yarn 4 (berry)
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
approvedGitRepositories:
- "**"

compressionLevel: mixed

enableGlobalCache: false

enableHardenedMode: false


nodeLinker: node-modules
3 changes: 3 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tools]
node = "20.11.1"
yarn = "4.14.1"
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,11 @@
"@vitejs/plugin-react": "^2.0.0",
"typescript": "^4.6.4",
"vite": "^3.0.2"
},
"packageManager": "yarn@4.14.1",
"dependenciesMeta": {
"esbuild": {
"built": true
}
}
}
4 changes: 2 additions & 2 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading