Skip to content

NoneBot Store Test #3746

NoneBot Store Test

NoneBot Store Test #3746

Workflow file for this run

name: "NoneBot Store Test"
on:
workflow_dispatch:
inputs:
offset:
description: "Offset"
required: false
default: "0"
limit:
description: "Limit"
required: false
default: "1"
args:
description: "Args"
required: false
default: ""
schedule:
- cron: "0 */4 * * *"
repository_dispatch:
types: [registry_update]
concurrency:
group: "store-test"
cancel-in-progress: false
jobs:
store_test:
runs-on: ubuntu-latest
name: NoneBot2 plugin test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: nonebot/noneflow
fetch-depth: 0
- name: Checkout latest noneflow version
run: git checkout `git describe --abbrev=0 --tags`
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Test plugin
if: ${{ !contains(fromJSON('["Bot", "Adapter", "Plugin"]'), github.event.client_payload.type) }}
run: uv run --no-dev -m src.providers.store_test plugin-test --offset ${{ github.event.inputs.offset || 0 }} --limit ${{ github.event.inputs.limit || 50 }} ${{ github.event.inputs.args }}
- name: Update registry
if: ${{ contains(fromJSON('["Bot", "Adapter", "Plugin"]'), github.event.client_payload.type) }}
run: uv run --no-dev -m src.providers.store_test registry-update
env:
REGISTRY_UPDATE_PAYLOAD: ${{ toJson(github.event.client_payload) }}
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: results
path: |
${{ github.workspace }}/plugin_test/results.json
${{ github.workspace }}/plugin_test/adapters.json
${{ github.workspace }}/plugin_test/bots.json
${{ github.workspace }}/plugin_test/drivers.json
${{ github.workspace }}/plugin_test/plugins.json
${{ github.workspace }}/plugin_test/plugin_configs.json
upload_results:
runs-on: ubuntu-latest
name: Upload results
needs: store_test
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: results
- name: Download results
uses: actions/download-artifact@v4
with:
name: results
path: ${{ github.workspace }}
- name: Push results
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add .
git diff-index --quiet HEAD || git commit -m "chore: update test results"
git push
upload_results_netlify:
runs-on: ubuntu-latest
name: Upload results to netlify
needs: store_test
permissions:
contents: read
deployments: write
statuses: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Setup Node Environment
uses: ./.github/actions/setup-node
- name: Download results
uses: actions/download-artifact@v4
with:
name: results
path: ${{ github.workspace }}/public
- name: Build Website
run: pnpm build
env:
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Get Branch Name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v3
with:
publish-dir: "./dist"
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy ${{ env.BRANCH_NAME }}@${{ github.sha }}"
enable-commit-comment: false
alias: ${{ env.BRANCH_NAME }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}