Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenbf committed Sep 14, 2023
1 parent b0c20ab commit cf274b1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 40 deletions.
72 changes: 38 additions & 34 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu

jobs:
build:
deps:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -50,6 +50,31 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn
- name: Get dependencies
run: yarn install --immutable

- name: Build GRPC bindings
if: steps.cache-grpc.outputs.cache-hit != 'true'
run: |
mkdir -p packages/common/src/grpc-api
mkdir -p packages/nodejs/src/grpc-api
yarn workspace @concordium/common-sdk generate
yarn workspace @concordium/node-sdk generate
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
needs: deps
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Cache WebPack
uses: actions/cache@v3
with:
Expand All @@ -58,8 +83,11 @@ jobs:
key: ${{ runner.os }}-webpack-${{ github.run_id }}
restore-keys: ${{ runner.os }}-webpack

- name: Get dependencies
run: yarn install --immutable
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn

- name: Install rust
run: rustup default ${{ env.RUST_VERSION }}
Expand All @@ -75,13 +103,13 @@ jobs:
with:
version: 'latest'

- name: Build GRPC bindings
if: steps.cache-grpc.outputs.cache-hit != 'true'
run: |
mkdir -p packages/common/src/grpc-api
mkdir -p packages/nodejs/src/grpc-api
yarn workspace @concordium/common-sdk generate
yarn workspace @concordium/node-sdk generate
- name: Restore grpc
uses: actions/cache/restore@v3
with:
path: |
./packages/common/src/grpc-api
./packages/nodejs/src/grpc-api
key: ${{ runner.os }}-grpc

- name: Build
run: yarn build:rust-bindings && yarn build:dev
Expand Down Expand Up @@ -114,14 +142,6 @@ jobs:
path: node_modules
key: ${{ runner.os }}-yarn

- name: Restore grpc
uses: actions/cache/restore@v3
with:
path: |
./packages/common/src/grpc-api
./packages/nodejs/src/grpc-api
key: ${{ runner.os }}-grpc

- name: Get build-debug
uses: ./.github/actions/download-artifact
with:
Expand Down Expand Up @@ -250,14 +270,6 @@ jobs:
path: node_modules
key: ${{ runner.os }}-yarn

- name: Restore grpc
uses: actions/cache/restore@v3
with:
path: |
./packages/common/src/grpc-api
./packages/nodejs/src/grpc-api
key: ${{ runner.os }}-grpc

- name: Lint markdown
run: yarn markdown:lint

Expand All @@ -278,14 +290,6 @@ jobs:
path: node_modules
key: ${{ runner.os }}-yarn

- name: Restore grpc
uses: actions/cache/restore@v3
with:
path: |
./packages/common/src/grpc-api
./packages/nodejs/src/grpc-api
key: ${{ runner.os }}-grpc

- name: Lint markdown
run: yarn markdown:linkcheck

Expand Down
8 changes: 4 additions & 4 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
},
"scripts": {
"generate-ts-v2-cjs": "yarn run grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts --ts_opt 'optimize_code_size,output_legacy_commonjs,output_javascript' --ts_out=lib/cjs/grpc-api -I ../../deps/concordium-base/concordium-grpc-api ../../deps/concordium-base/concordium-grpc-api/v2/concordium/*.proto",
"generate-ts-v2": "yarn run grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts --ts_opt 'optimize_code_size,output_javascript' --ts_out=lib/esm/grpc-api -I ../../deps/concordium-base/concordium-grpc-api ../../deps/concordium-base/concordium-grpc-api/v2/concordium/*.proto",
"generate": "([ -e \"../../deps/concordium-base/concordium-grpc-api\" ] && yarn generate-ts-v2 && yarn generate-ts-v2-cjs && cp -R lib/esm/grpc-api src) || echo 'Please checkout submodules before building'",
"generate-ts-v2": "yarn run grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts --ts_opt 'optimize_code_size,output_javascript' --ts_out=src/grpc-api -I ../../deps/concordium-base/concordium-grpc-api ../../deps/concordium-base/concordium-grpc-api/v2/concordium/*.proto",
"generate": "([ -e \"../../deps/concordium-base/concordium-grpc-api\" ] && yarn generate-ts-v2) || echo 'Please checkout submodules before building'",
"lint": "eslint . --cache --ext .ts,.tsx --max-warnings 0",
"lint-fix": "yarn --silent lint --fix; exit 0",
"test": "jest",
"build": "rm -rf src/grpc-api lib/esm/grpc-api lib/cjs/grpc-api; mkdir -p src/grpc-api lib/esm/grpc-api lib/cjs/grpc-api; yarn generate && yarn build-dev",
"build-dev": "yarn tsc-esm && yarn tsc-cjs",
"build": "rm -rf src/grpc-api lib/cjs/grpc-api; mkdir -p src/grpc-api lib/cjs/grpc-api; yarn generate && yarn build-dev",
"build-dev": "yarn tsc-esm && yarn tsc-cjs && cp -R src/grpc-api lib/esm && yarn generate-ts-v2-cjs",
"tsc-esm": "tsc -p tsconfig.build.json",
"tsc-cjs": "tsc -p tsconfig.build.json --outDir ./lib/cjs --module commonjs",
"clean": "rimraf -- lib src/grpc-api"
Expand Down
4 changes: 2 additions & 2 deletions packages/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"lint": "eslint . --cache --ext .ts,.tsx --max-warnings 0",
"lint-fix": "yarn --silent lint --fix; exit 0",
"test": "jest",
"build": "rm -rf src/grpc-api; mkdir -p src/grpc-api; yarn generate && yarn build-dev && cp -R src/grpc-api lib",
"build-dev": "yarn tsc-cjs",
"build": "rm -rf src/grpc-api; mkdir -p src/grpc-api; yarn generate && yarn build-dev",
"build-dev": "yarn tsc-cjs && cp -R src/grpc-api lib",
"tsc-cjs": "tsc -p tsconfig.build.json",
"clean": "rimraf -- lib src/grpc-api tsconfig.build.tsbuildinfo"
},
Expand Down

0 comments on commit cf274b1

Please sign in to comment.