mirror of
https://github.com/tlsnotary/tlsn-js.git
synced 2026-04-02 03:00:18 -04:00
Update to alpha.9 + added way to co-develop tlsn-wasm (#99)
This commit is contained in:
32
.github/workflows/build.yaml
vendored
32
.github/workflows/build.yaml
vendored
@@ -1,32 +0,0 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
env:
|
||||
PUPPETEER_SKIP_DOWNLOAD: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
97
.github/workflows/ci.yaml
vendored
Normal file
97
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
LOCAL-NOTARY: true
|
||||
LOCAL-WS: false
|
||||
HEADLESS: true
|
||||
PUPPETEER_SKIP_DOWNLOAD: true
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: Build and test
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RELEASE_MODE: 'dry-run' # dry-run by default, will be set to 'publish' for release builds
|
||||
services:
|
||||
notary-server:
|
||||
image: ghcr.io/tlsnotary/tlsn/notary-server:v0.1.0-alpha.9
|
||||
env:
|
||||
NOTARY_SERVER__TLS__ENABLED: false
|
||||
ports:
|
||||
- 7047:7047
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout tlsn
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: tlsnotary/tlsn
|
||||
path: tlsn-wasm/tlsn
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install stable nightly toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: wasm32-unknown-unknown
|
||||
components: rust-src
|
||||
toolchain: nightly
|
||||
|
||||
- name: Use caching
|
||||
uses: Swatinem/rust-cache@v2.7.7
|
||||
with:
|
||||
workspaces: tlsn-wasm/tlsn -> target
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Install wasm-pack
|
||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Install Chrome
|
||||
uses: browser-actions/setup-chrome@v1
|
||||
id: setup-chrome
|
||||
with:
|
||||
chrome-version: 121.0.6167.85
|
||||
|
||||
- name: Set CHROME_PATH environment variable
|
||||
run: echo "CHROME_PATH=${{ steps.setup-chrome.outputs['chrome-path'] }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Test
|
||||
run: npm run test
|
||||
|
||||
- name: Determine release type (dry-run or publish)
|
||||
run: |
|
||||
if [[ $GITHUB_EVENT_NAME == "release" ]]; then
|
||||
echo "RELEASE_MODE=publish" >> $GITHUB_ENV
|
||||
else
|
||||
echo "RELEASE_MODE=dry-run" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Dry-run release (non-release builds)
|
||||
if: env.RELEASE_MODE == 'dry-run'
|
||||
run: npm publish --dry-run
|
||||
|
||||
- name: Publish to npm (GitHub Release)
|
||||
if: env.RELEASE_MODE == 'publish'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: npm publish
|
||||
62
.github/workflows/test.yaml
vendored
62
.github/workflows/test.yaml
vendored
@@ -1,62 +0,0 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
LOCAL-NOTARY: true
|
||||
LOCAL-WS: false
|
||||
HEADLESS: true
|
||||
PUPPETEER_SKIP_DOWNLOAD: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
notary-server:
|
||||
image: ghcr.io/tlsnotary/tlsn/notary-server:v0.1.0-alpha.8
|
||||
env:
|
||||
NOTARY_SERVER__TLS__ENABLED: false
|
||||
ports:
|
||||
- 7047:7047
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install stable rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: wasm32-unknown-unknown
|
||||
toolchain: nightly
|
||||
|
||||
- name: Use caching
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Install Chrome
|
||||
uses: browser-actions/setup-chrome@v1
|
||||
id: setup-chrome
|
||||
with:
|
||||
chrome-version: 121.0.6167.85
|
||||
|
||||
- name: Set CHROME_PATH environment variable
|
||||
run: echo "CHROME_PATH=${{ steps.setup-chrome.outputs['chrome-path'] }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install nightly tool-chain
|
||||
run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Test
|
||||
run: npm run test
|
||||
Reference in New Issue
Block a user