Repository navigation
90 lines (87 loc) · 2.64 KB
/
Copy pathjavascript.yml
File metadata and controls
90 lines (87 loc) · 2.64 KB
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
name: Build and Test JavaScript
on:
workflow_run:
workflows: ["Flake maintenance"]
types: [requested]
branches:
- "update_flake_lock_action"
pull_request:
paths:
- payjoin-ffi/**
# The jobs run inside the flake's dev shell, so changes to the flake
# change this workflow's environment.
- flake.nix
- flake.lock
workflow_call:
jobs:
build-js-and-test:
name: "Build and test javascript"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-26.04, macos-latest]
env:
RUSTUP_TOOLCHAIN: 1.85.0
steps:
- name: Checkout
uses: actions/checkout@v6
- name: "Install Rust 1.85.0"
uses: dtolnay/rust-toolchain@1.85.0
- name: "Use cache"
uses: Swatinem/rust-cache@v2
with:
shared-key: msrv-workspace
- name: Set up nix
uses: ./.github/actions/setup-nix
- name: "Build and test"
run: nix develop .#javascript -c ./payjoin-ffi/javascript/contrib/test.sh
pack-npm:
# The package ships only dist/ (wasm + compiled TypeScript), which is
# platform-independent, so one pack on Linux is the entire release build.
name: "Pack npm package"
runs-on: ubuntu-26.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: "Use cache"
uses: Swatinem/rust-cache@v2
- name: Set up nix
uses: ./.github/actions/setup-nix
- name: Build and pack
run: nix develop .#javascript -c ./payjoin-ffi/javascript/contrib/pack.sh
- name: Upload npm package
uses: actions/upload-artifact@v4
with:
name: payjoin-javascript-npm-package
path: payjoin-ffi/javascript/artifacts/*.tgz
if-no-files-found: error
smoke-npm:
name: "Smoke test npm package"
runs-on: ${{ matrix.os }}
needs: pack-npm
strategy:
matrix:
os: [ubuntu-26.04, macos-latest]
steps:
- name: Download npm package
uses: actions/download-artifact@v4
with:
name: payjoin-javascript-npm-package
path: pkg
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Install and exercise the packed package
shell: bash
run: |
set -euo pipefail
mkdir smoke && cd smoke
npm init -y >/dev/null
npm install ../pkg/payjoin-*.tgz
node --input-type=module -e '
import { payjoin, uniffiInitAsync } from "payjoin";
await uniffiInitAsync();
payjoin.Url.parse("https://example.com");
console.log("smoke ok");
'