generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
store-test.yml
137 lines (120 loc) · 3.98 KB
/
store-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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@v3
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 }}