mirror of
https://github.com/iDvel/rime-ice.git
synced 2026-05-14 00:30:37 +08:00
test: add rime smoke framework (#1511)
* test: add config smoke framework * ci: add smoke test before packing * ci: add cache
This commit is contained in:
45
.github/workflows/pages.yml
vendored
45
.github/workflows/pages.yml
vendored
@@ -1,45 +0,0 @@
|
||||
name: Deploy rime-ice with fcitx5-rime.js
|
||||
|
||||
on:
|
||||
# push:
|
||||
# branches:
|
||||
# - main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build rime-ice
|
||||
uses: rimeinn/deploy-schema@master
|
||||
with:
|
||||
user-recipe-list: |-
|
||||
iDvel/rime-ice:others/recipes/full
|
||||
shared-recipe-list:
|
||||
package-items: |-
|
||||
build
|
||||
lua
|
||||
opencc
|
||||
custom_phrase.txt
|
||||
|
||||
- name: Download fcitx5-rime.js
|
||||
run: |
|
||||
curl -L -o fcitx5-rime.tgz https://github.com/rimeinn/fcitx5-rime.js/releases/download/latest/fcitx5-rime.tgz
|
||||
mkdir -p fcitx5-rime
|
||||
tar -xzvf fcitx5-rime.tgz -C fcitx5-rime
|
||||
|
||||
- name: Move files to publish directory
|
||||
run: |
|
||||
mkdir -p ./public/dist
|
||||
mv /tmp/deploy-schema/artifact.zip ./public/rime-ice.zip
|
||||
mv fcitx5-rime/package/dist/* ./public/dist
|
||||
cp others/pages/index.html ./public/index.html
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./public
|
||||
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
@@ -14,13 +14,40 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
Release:
|
||||
runs-on: ubuntu-latest
|
||||
smoke:
|
||||
name: Smoke test before release
|
||||
runs-on: ubuntu-24.04
|
||||
# if: github.repository == 'iDvel/rime-ice'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Cache rime cli bundle
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ runner.temp }}/rime-cli-cache/rime-cli-linux-1.6.1.zip
|
||||
key: rime-cli-linux-1.6.1
|
||||
|
||||
- name: Run smoke test suite
|
||||
env:
|
||||
RIME_CLI_URL: https://github.com/mirtlecn/public/releases/download/v1.6.1/rime-cli-linux-1.6.1.zip
|
||||
RIME_CLI_CACHE_PATH: ${{ runner.temp }}/rime-cli-cache/rime-cli-linux-1.6.1.zip
|
||||
run: bash ./others/script/smoke/run.sh rime_ice
|
||||
|
||||
package:
|
||||
name: Package and release
|
||||
runs-on: ubuntu-24.04
|
||||
if: github.repository == 'iDvel/rime-ice'
|
||||
needs:
|
||||
- smoke
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Go
|
||||
if: ${{ contains(github.event.head_commit.message, ' [build]') || github.event_name == 'workflow_dispatch' }}
|
||||
@@ -56,7 +83,7 @@ jobs:
|
||||
|
||||
- name: Create nightly release
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
uses: "softprops/action-gh-release@v2"
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body: |
|
||||
## 说明
|
||||
@@ -79,7 +106,7 @@ jobs:
|
||||
|
||||
- name: Create stable release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: "softprops/action-gh-release@v2"
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body: |
|
||||
## 说明
|
||||
@@ -108,4 +135,4 @@ jobs:
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit."
|
||||
fi
|
||||
fi
|
||||
|
||||
37
.github/workflows/test.yml
vendored
Normal file
37
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Smoke test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- main
|
||||
paths:
|
||||
- "**/**"
|
||||
- "!**.md"
|
||||
- "!**.gitignore"
|
||||
- "!.github/**"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
smoke-linux:
|
||||
name: Rime smoke test
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Cache rime cli bundle
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ runner.temp }}/rime-cli-cache/rime-cli-linux-1.6.1.zip
|
||||
key: rime-cli-linux-1.6.1
|
||||
|
||||
- name: Run smoke test suite
|
||||
env:
|
||||
RIME_CLI_URL: https://github.com/mirtlecn/public/releases/download/v1.6.1/rime-cli-linux-1.6.1.zip
|
||||
RIME_CLI_CACHE_PATH: ${{ runner.temp }}/rime-cli-cache/rime-cli-linux-1.6.1.zip
|
||||
run: bash ./others/script/smoke/run.sh rime_ice
|
||||
Reference in New Issue
Block a user