2020-09-26 20:44:36 +00:00
|
|
|
name: "CI"
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- 'dependabot/**'
|
2020-09-27 19:54:28 +00:00
|
|
|
- release
|
2020-09-26 20:44:36 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-tauri:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-09-27 20:03:54 +00:00
|
|
|
platform: [macos-latest, ubuntu-18.04, windows-latest]
|
2020-09-26 20:44:36 +00:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-04-05 21:49:51 +00:00
|
|
|
- name: Install GNU tar
|
|
|
|
if: runner.os == 'macOS'
|
|
|
|
run: |
|
2021-04-05 21:55:00 +00:00
|
|
|
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
|
2020-09-26 23:36:40 +00:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2020-09-27 19:06:23 +00:00
|
|
|
key: ${{ matrix.platform }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
2020-09-26 23:36:40 +00:00
|
|
|
restore-keys: |
|
2020-09-27 19:08:00 +00:00
|
|
|
${{ matrix.platform }}-yarn-
|
2020-09-26 23:36:40 +00:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
~/.cargo/bin
|
2020-10-02 01:22:35 +00:00
|
|
|
desktop/src-tauri/target
|
2021-04-05 22:07:40 +00:00
|
|
|
key: ${{ matrix.platform }}-cargo-v2-${{ hashFiles('**/Cargo.lock') }}
|
2020-09-26 23:36:40 +00:00
|
|
|
restore-keys: |
|
2021-04-05 22:07:40 +00:00
|
|
|
${{ matrix.platform }}-cargo-v2-
|
2020-09-26 20:44:36 +00:00
|
|
|
- name: setup node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
- name: install Rust stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- name: install tauri bundler
|
2020-09-27 00:27:06 +00:00
|
|
|
if: runner.os != 'Windows'
|
2020-09-27 00:04:33 +00:00
|
|
|
run: cargo install tauri-bundler || [ $? -eq 101 ]
|
2020-09-27 00:27:06 +00:00
|
|
|
- name: install tauri bundler
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: cargo install tauri-bundler; exit ($LASTEXITCODE -ne 101 -and $LASTEXITCODE -ne 0)
|
|
|
|
shell: powershell -command "& '{0}'"
|
2020-09-26 20:44:36 +00:00
|
|
|
- name: install webkit2gtk (ubuntu only)
|
2020-09-27 20:03:54 +00:00
|
|
|
if: matrix.platform == 'ubuntu-18.04'
|
2020-09-26 20:44:36 +00:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2020-09-26 22:02:26 +00:00
|
|
|
sudo apt-get install -y webkit2gtk-4.0 squashfs-tools
|
2020-09-26 20:44:36 +00:00
|
|
|
- name: install app dependencies
|
|
|
|
run: yarn
|
2020-09-27 00:55:08 +00:00
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
npmScript: "tauri:build"
|
2020-10-02 01:22:35 +00:00
|
|
|
projectPath: desktop/
|
2020-09-27 00:55:08 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-09-27 02:23:33 +00:00
|
|
|
name: my-artifact-${{ runner.os }}
|
2020-10-02 01:22:35 +00:00
|
|
|
path: desktop/src-tauri/target/release/bundle
|
2020-10-06 14:48:41 +00:00
|
|
|
test-web:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ matrix.platform }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
2020-10-06 14:51:33 +00:00
|
|
|
ubuntu-18.04-yarn-
|
2020-10-06 14:48:41 +00:00
|
|
|
- name: setup node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
- name: install app dependencies
|
|
|
|
run: yarn
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2020-10-06 15:01:36 +00:00
|
|
|
yarn workspace web run generate
|