Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyob committed Oct 12, 2023
1 parent 2813b2a commit 932f4d8
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 63 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/pull-request-nix.yml

This file was deleted.

111 changes: 85 additions & 26 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,100 @@ on:
branches: [main]

jobs:
# fmt:
# name: Format
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
# components: rustfmt
# - uses: luisnquin/[email protected]

# - name: Format (rustfmt)
# run: make fmt-rust-check

# - name: Format (prettier)
# run: npx prettier --check .

# - name: Format (Nix)
# run: make fmt-nix-check
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: rustfmt
- uses: luisnquin/[email protected]

- name: Format (rustfmt)
run: make fmt-rust-check

- name: Format (prettier)
run: npx prettier --check .

- name: Format (Nix)
run: make fmt-nix-check

build:
name: Build `jstz_kernel`
name: Build (Cargo)
runs-on: ubuntu-latest
needs: fmt
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
target: wasm32-unknown-unknown
- uses: KyleMayes/install-llvm-action@v1
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build

build-sdk:
name: Build TypeScript SDK
runs-on: ubuntu-latest
needs: fmt
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
version: 16.0.0
env: true
node-version: 18
cache: npm
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Configure npm cache
uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci

- name: Build
run: make build
run: cd packages/jstz && npm run build

build-nix:
name: Build (Nix)
runs-on: ubuntu-latest
needs: [build, build-sdk]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: trilitech-jstz
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build Shell
run: nix develop --command bash -c "echo 'Hello World'"

- name: Build
run: nix build

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: kernel
path: result/lib
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ node_modules/
# Vitepress directories
**/.vitepress/cache
**/.vitepress/dist

**/dist
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore git and node_modules:
**/.git
**/node_modules

# Ignore artifacts:
**/dist
2 changes: 1 addition & 1 deletion packages/jstz-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ declare interface Kv {

declare var Kv: Kv;

export type Mutez = number;
declare type Mutez = number;

declare interface Ledger {
readonly selfAddress: Address;
Expand Down
3 changes: 0 additions & 3 deletions packages/jstz/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/jstz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "index.ts",
"scripts": {
"check:types": "tsc --noEmit",
"build": "tsc"
"build": "tsc --outDir dist"
},
"dependencies": {
"@tezos/jstz-types": "^0.0.0"
Expand Down

0 comments on commit 932f4d8

Please sign in to comment.