Skip to content

Commit

Permalink
feat: set workspace
Browse files Browse the repository at this point in the history
fix: fix github action yaml err

fix: fix github action yaml

feat: add package command for github action

fix: update settings

fix: fix dependency error

fix: update node version for github action

fix: fix linter error

fix: update package dependency
  • Loading branch information
nick-bisonai committed Nov 24, 2023
1 parent b3c548d commit 84d23b4
Show file tree
Hide file tree
Showing 1,002 changed files with 31,457 additions and 183 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/admin.image+upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
paths:
- "admin/**"
- "packages/admin/**"

env:
ecr_url: public.ecr.aws/bisonai/orakl-general
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Get package version
id: package
run: |
echo "version=$(node -p -e "require('./api/package.json').version")" >> $GITHUB_OUTPUT
echo "version=$(node -p -e "require('.packages/api/package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
Expand All @@ -52,7 +52,7 @@ jobs:

- name: Docker build orakl-admin
run: |
docker build -t orakl-general-admin admin/. \
docker build -t orakl-general-admin packages/admin/. \
--build-arg ORAKL_URL=http://localhost:3030 \
--build-arg MONITOR_URL=http://localhost:8888 \
--build-arg DELEGATOR_URL=http://localhost:5050 \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/api.image+upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
paths:
- "api/**"
- "packages/api/**"

env:
ecr_url: public.ecr.aws/bisonai/orakl-api
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Get package version
id: package
run: |
echo "version=$(node -p -e "require('./api/package.json').version")" >> $GITHUB_OUTPUT
echo "version=$(node -p -e "require('./packages/api/package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3

- name: Docker build orakl-api
run: docker-compose -f api/docker-compose.build.yaml build
run: docker-compose -f packages/api/docker-compose.build.yaml build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/api.test+build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches-ignore:
- "master"
paths:
- "api/**"
- "packages/api/**"

jobs:
core-build:
Expand All @@ -30,26 +30,21 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.12"
node-version: "18.16"
- name: Install dependencies
run: yarn install
working-directory: ./api
run: yarn workspace @bisonai/orakl-api install
- name: Run eslint
run: yarn lint
working-directory: ./api
run: yarn workspace @bisonai/orakl-api lint
- name: Run test
run: |
npx prisma migrate dev --name init
yarn test
yarn workspace @bisonai/orakl-api test
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/orakl-test?schema=public"
ENCRYPT_PASSWORD: "abc123"
working-directory: ./api
- name: Run e2e2 test
run: yarn test:e2e --forceExit
run: yarn workspace @bisonai/orakl-api test:e2e --forceExit
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/orakl-test?schema=public"
working-directory: ./api
- name: Build package
run: yarn build
working-directory: ./api
run: yarn workspace @bisonai/orakl-api build
18 changes: 7 additions & 11 deletions .github/workflows/cli.build+publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches-ignore:
- "master"
paths:
- "cli/**"
- "packages/cli/**"

jobs:
build-publish:
Expand All @@ -16,30 +16,26 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.12"
node-version: "18.16"
registry-url: "https://registry.npmjs.org"
scope: "@bisonai"
always-auth: true
- name: Install dependencies
run: yarn --cwd . install
working-directory: ./cli
run: yarn workspace @bisonai/orakl-cli install
- name: Run lint
run: yarn --cwd . lint
working-directory: ./cli
run: yarn workspace @bisonai/orakl-cli lint --fix
- name: Build package
run: yarn --cwd . build
working-directory: ./cli
run: yarn workspace @bisonai/orakl-cli build
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: packageJsonVersion
with:
cmd: "jq .version ./cli/package.json -r"
cmd: "jq .version ./packages/cli/package.json -r"
- name: Extract version from the latest published package
id: npmPackageVersion
run: echo "VERSION=`npm view @bisonai/orakl-cli version`" >> $GITHUB_OUTPUT
- name: Publish package
if: steps.packageJsonVersion.outputs.value != steps.npmPackageVersion.outputs.VERSION
run: yarn publish --new-version ${{ steps.packageJsonVersion.outputs.value }} --access public
working-directory: ./cli
run: yarn workspace @bisonai/orakl-cli publish --new-version ${{ steps.packageJsonVersion.outputs.value }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/cli.image+upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
paths:
- "cli/**"
- "packages/cli/**"

env:
ecr_url: public.ecr.aws/bisonai/orakl-cli
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Get package version
id: package
run: |
echo "version=$(node -p -e "require('./cli/package.json').version")" >> $GITHUB_OUTPUT
echo "version=$(node -p -e "require('./packages/cli/package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3

- name: Docker build orakl-cli
run: docker-compose -f cli/docker-compose.build.yaml build
run: docker-compose -f packages/cli/docker-compose.build.yaml build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
36 changes: 14 additions & 22 deletions .github/workflows/contracts.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
branches-ignore:
- "master"
paths:
- "contracts/**"
- "!contracts/**/VRFCoordinator.sol"
- "!contracts/**/VRFConsumerBase.sol"
- "!contracts/**/vrf/**"
- "packages/contracts/**"
- "!packages/contracts/**/VRFCoordinator.sol"
- "!packages/contracts/**/VRFConsumerBase.sol"
- "!packages/contracts/**/vrf/**"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -18,39 +18,31 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.12"
node-version: "18.16"
registry-url: "https://registry.npmjs.org"
scope: "@bisonai"
always-auth: true
- run: yarn
working-directory: ./contracts
- run: yarn prettier-solidity-check
working-directory: ./contracts
- run: yarn solhint
working-directory: ./contracts
- run: yarn eslint
working-directory: ./contracts
- run: npx hardhat test test/v0.1/non-vrf/*.cjs
working-directory: ./contracts
- run: yarn workspace @bisonai/orakl-contracts install
- run: yarn workspace @bisonai/orakl-contracts prettier-solidity-check
- run: yarn workspace @bisonai/orakl-contracts solhint
- run: yarn workspace @bisonai/orakl-contracts eslint
- run: yarn workspace @bisonai/orakl-contracts test-non-vrf
env:
L2_PROVIDER: ${{ secrets.L2_PROVIDER }}
- run: yarn compile
working-directory: ./contracts
- run: yarn workspace @bisonai/orakl-contracts compile
env:
L2_PROVIDER: ${{ secrets.L2_PROVIDER }}
- run: yarn build
working-directory: ./contracts
- run: yarn workspace @bisonai/orakl-contracts build
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: packageJsonVersion
with:
cmd: "jq .version ./contracts/package.json -r"
cmd: "jq .version ./packages/contracts/package.json -r"
- name: Extract version from the latest published package
id: npmPackageVersion
run: echo "VERSION=`npm view @bisonai/orakl-contracts version`" >> $GITHUB_OUTPUT
- name: Publish package
if: steps.packageJsonVersion.outputs.value != steps.npmPackageVersion.outputs.VERSION
run: yarn publish --new-version ${{ steps.packageJsonVersion.outputs.value }} --access public
working-directory: ./contracts
run: yarn workspace @bisonai/orakl-contracts publish --new-version ${{ steps.packageJsonVersion.outputs.value }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/core.image+upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
paths:
- "core/**"
- "packages/core/**"
workflow_dispatch:

env:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Get package version
id: package
run: |
echo "version=$(node -p -e "require('./core/package.json').version")" >> $GITHUB_OUTPUT
echo "version=$(node -p -e "require('./packages/core/package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
Expand All @@ -53,13 +53,13 @@ jobs:

- name: Replace symlink with real files
run: |
rm -f ./core/src/por/job.errors.ts ./core/src/por/job.types.ts ./core/src/por/reducer.ts
cp ./fetcher/src/job/job.errors.ts ./core/src/por/job.errors.ts
cp ./fetcher/src/job/job.types.ts ./core/src/por/job.types.ts
cp ./fetcher/src/job/job.reducer.ts ./core/src/por/reducer.ts
rm -f ./packages/core/src/por/job.errors.ts ./packages/core/src/por/job.types.ts ./packages/core/src/por/reducer.ts
cp ./packages/fetcher/src/job/job.errors.ts ./packages/core/src/por/job.errors.ts
cp ./packages/fetcher/src/job/job.types.ts ./packages/core/src/por/job.types.ts
cp ./packages/fetcher/src/job/job.reducer.ts ./packages/core/src/por/reducer.ts
- name: Docker build orakl-core
run: docker-compose -f core/docker-compose.build.yaml build
run: docker-compose -f packages/core/docker-compose.build.yaml build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/core.test+build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches-ignore:
- "master"
paths:
- "core/**"
- "packages/core/**"

jobs:
core-build:
Expand All @@ -16,24 +16,20 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.12"
node-version: "18.16"
- name: Install dependencies
run: yarn install
working-directory: ./core
run: yarn workspace @bisonai/orakl-core install
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run lint
run: yarn lint
working-directory: ./core
run: yarn workspace @bisonai/orakl-core lint
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run test
run: yarn test
working-directory: ./core
run: yarn workspace @bisonai/orakl-core test
env:
ORAKL_DIR: "./"
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CAVER_PRIVATE_KEY: ${{ secrets.CAVER_PRIVATE_KEY}}
- name: Build package
run: yarn build
working-directory: ./core
run: yarn workspace @bisonai/orakl-core build
6 changes: 3 additions & 3 deletions .github/workflows/delegator.image+upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
paths:
- "delegator/**"
- "packages/delegator/**"

env:
ecr_url: public.ecr.aws/bisonai/orakl-delegator
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Get package version
id: package
run: |
echo "version=$(node -p -e "require('./delegator/package.json').version")" >> $GITHUB_OUTPUT
echo "version=$(node -p -e "require('./packages/delegator/package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3

- name: Docker build orakl-core
run: docker-compose -f delegator/docker-compose.build.yaml build
run: docker-compose -f packages/delegator/docker-compose.build.yaml build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/delegator.test+build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches-ignore:
- "master"
paths:
- "delegator/**"
- "packages/delegator/**"

jobs:
core-build:
Expand All @@ -30,23 +30,20 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.12"
node-version: "18.16"
- name: Install dependencies
run: yarn install
working-directory: ./delegator
run: yarn workspace @bisonai/orakl-delegator install
- name: Run eslint
run: yarn lint
working-directory: ./delegator
run: yarn workspace @bisonai/orakl-delegator lint
- name: Run test
run: |
npx prisma migrate dev --name init
yarn test
yarn workspace @bisonai/orakl-delegator test
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/orakl-test?schema=public"
PROVIDER_URL: "https://api.baobab.klaytn.net:8651"
DELEGATOR_FEEPAYER_PK: ${{ secrets.DELEGATOR_FEEPAYER_PK}}
TEST_DELEGATOR_REPORTER_PK: ${{ secrets.TEST_DELEGATOR_REPORTER_PK}}
working-directory: ./delegator
- name: Build package
run: yarn build
working-directory: ./delegator
run: yarn workspace @bisonai/orakl-delegator build

Loading

0 comments on commit 84d23b4

Please sign in to comment.