diff --git a/.github/workflows/Jobs.yml b/.github/workflows/Jobs.yml new file mode 100644 index 0000000..bc4aa1a --- /dev/null +++ b/.github/workflows/Jobs.yml @@ -0,0 +1,102 @@ +name: Lint, Format, and Test + +on: push + +jobs: + tests: + name: Matchstick + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:14 + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18.x + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run codegen + run: yarn codegen + + - name: Run build + run: yarn build + + - name: Run tests + run: yarn test + + lint: + name: ESLint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run ESLint + run: yarn lint + + format: + name: Prettier + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run Prettier + run: yarn format:check diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 90dcaf6..0000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Format - -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - -jobs: - format: - name: Prettier - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Run Prettier - run: yarn format:check diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 50f4d49..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Lint - -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - -jobs: - lint: - name: ESLint - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Run ESLint - run: yarn lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 694831e..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Tests - -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - -jobs: - tests: - name: Matchstick - runs-on: macos-12-m1 - container: node:18 - - services: - postgres: - image: postgres:14 - env: - POSTGRES_PASSWORD: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "yarn" - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Run codegen - run: yarn codegen - - - name: Run build - run: yarn build:local - - - name: Run tests - run: yarn test diff --git a/package.json b/package.json index 3c934b2..ce8c111 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "mac": "docker-compose --file mac.yaml up --build", "intel": "docker-compose --file intel.yaml up --build", "codegen": "lerna run codegen", + "build": "lerna run build", "build:local": "lerna run build:local", "build:goerli": "lerna run build:goerli", "build:mainnet": "lerna run build:mainnet", diff --git a/subgraphs/chamber/schema.graphql b/subgraphs/chamber/schema.graphql index 3ac5a1f..6f15cb4 100644 --- a/subgraphs/chamber/schema.graphql +++ b/subgraphs/chamber/schema.graphql @@ -19,7 +19,6 @@ type OwnershipTransferred @entity(immutable: true) { transactionHash: Bytes! } - type ChangedGuard @entity(immutable: true) { id: ID! guard: Bytes! # address diff --git a/subgraphs/loreum-nft/package.json b/subgraphs/loreum-nft/package.json index ee95374..d9a0379 100644 --- a/subgraphs/loreum-nft/package.json +++ b/subgraphs/loreum-nft/package.json @@ -8,6 +8,7 @@ "scripts": { "start": "yarn codegen && yarn build:local && yarn remove:local && yarn create:local && yarn deploy:local", "codegen": "graph codegen", + "build": "graph build subgraph.yaml", "build:local": "graph build subgraph.yaml --network localhost", "create:local": "graph create --node http://localhost:8020/ loreum-nft --network localhost", "remove:local": "graph remove --node http://localhost:8020/ loreum-nft --network localhost",