generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (58 loc) · 1.58 KB
/
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
name: Test
on:
pull_request:
push:
branches:
- main
jobs:
unit-test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
env:
NOSTR_RELAYS: ${{ vars.NOSTR_RELAYS_TEST }}
NOSTR_PRIVATE_KEY: ${{ secrets.NOSTR_PRIVATE_KEY_TEST }}
e2e-test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
# kind 1 (default)
- uses: ./
with:
relays: ${{ vars.NOSTR_RELAYS_TEST }}
private-key: ${{ secrets.NOSTR_PRIVATE_KEY_TEST }}
content: |
test
https://github.com/snow-actions/nostr
id: publish
- run: test "$event" != ''
env:
event: ${{ steps.publish.outputs.event }}
# reply
- uses: ./
with:
relays: ${{ vars.NOSTR_RELAYS_TEST }}
private-key: ${{ secrets.NOSTR_PRIVATE_KEY_TEST }}
content: test reply
tags: |
- ["e", "${{ fromJson(steps.publish.outputs.event).id }}", "", "root"]
- ["p", "${{ fromJson(steps.publish.outputs.event).pubkey }}"]
id: publish-reply
- run: test "$event" != ''
env:
event: ${{ steps.publish-reply.outputs.event }}
# kind 2
- uses: ./
with:
relays: ${{ vars.NOSTR_RELAYS_TEST }}
private-key: ${{ secrets.NOSTR_PRIVATE_KEY_TEST }}
content: wss://relay.nostr.wirednet.jp
kind: 2
id: publish-2
- run: test $(echo "$event" | jq '.kind') = 2
env:
event: ${{ steps.publish-2.outputs.event }}