Merge pull request #166 from snow-actions/error-handling #274
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Package | |
run: | | |
npm ci | |
npm run package | |
# 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 }} |