-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Graphql support to scribe's data (#165)
Co-authored-by: Trajan0x <[email protected]>
- Loading branch information
1 parent
8d51934
commit 7d59e36
Showing
63 changed files
with
10,486 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,14 +232,15 @@ jobs: | |
GOGC: 20 | ||
|
||
# check if we need to rerun go generate as a result of solidity changes. Note, this will only run on solidity changes. | ||
check-generation: | ||
name: Go Generate | ||
# TODO: consolidate w/ go change check. This will run twice on agents | ||
check-generation-solidity: | ||
name: Go Generate (Solidity Only) | ||
runs-on: ubuntu-latest | ||
needs: changes | ||
if: ${{ github.event_name != 'pull_request' && needs.changes.outputs.solidity_changes }} | ||
strategy: | ||
matrix: | ||
# only do on agents for now | ||
# only do on agents for now. Anything that relies on solidity in a package should do this | ||
package: ['agents'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -295,14 +296,135 @@ jobs: | |
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
# use seperate cache for generate, builds less stuff | ||
# TODO: consider scoping to package | ||
key: ${{ runner.os }}-go-generate-${{matrix.package}}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
${{ runner.os }}-go-generate-${{matrix.package}} | ||
# TODO: remove | ||
- name: authenticate with github for private go modules | ||
if: ${{github.event.repository.private}} | ||
uses: fusion-engineering/setup-git-credentials@v2 | ||
with: | ||
credentials: https://trajan0x:${{secrets.GIT_TOKEN }}@github.com/ | ||
|
||
# See if we need to rerun go generate | ||
# TODO: consider implementing https://github.com/golang/go/issues/20520 to sped up process if possible | ||
- name: Try Go Generate | ||
working-directory: ${{matrix.package}}/ | ||
run: | | ||
go generate ./... | ||
- name: Verify Changed files | ||
uses: tj-actions/[email protected] | ||
id: verify-changed-files | ||
with: | ||
files: | | ||
*.go | ||
- uses: jwalton/gh-find-current-pr@v1 | ||
id: find_pr | ||
|
||
# Fail if files need regeneration | ||
- name: Add Label | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 | ||
with: | ||
add-labels: 'needs-go-generate-${{matrix.package}}' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ steps.find_pr.outputs.pr }} | ||
|
||
- name: Remove Label | ||
if: steps.verify-changed-files.outputs.files_changed != 'true' | ||
uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 | ||
with: | ||
remove-labels: 'needs-go-generate-${{matrix.package}}' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ steps.find_pr.outputs.pr }} | ||
|
||
check-generation: | ||
name: Go Generate (Module Changes) | ||
runs-on: ubuntu-latest | ||
needs: changes | ||
if: ${{ github.event_name != 'pull_request' && needs.changes.outputs.package_count > 0 }} | ||
strategy: | ||
matrix: | ||
# only do on agents for now. Anything that relies on solidity in a package should do this | ||
package: ${{ fromJSON(needs.changes.outputs.packages) }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
|
||
# Setup npm | ||
- name: Read .nvmrc | ||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" | ||
id: nvmrc | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: 'Use NodeJS by nvmrc' | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '${{steps.nvmrc.outputs.NVMRC}}' | ||
|
||
- name: Initialize Yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Node Dependencies | ||
run: yarn install --frozen-lockfile --check-files | ||
|
||
- name: Install dependencies | ||
run: | | ||
npx lerna bootstrap | ||
# Generate flattened files | ||
- name: Run flattener | ||
run: npx lerna exec npm run build:go | ||
|
||
# Setup Go | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Go modules cache | ||
uses: actions/cache@v2 | ||
with: | ||
# see https://github.com/mvdan/github-actions-golang | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
# use seperate cache for generate, builds less stuff | ||
# TODO: consider scoping to package | ||
key: ${{ runner.os }}-go-generate-${{matrix.package}}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-generate-${{matrix.package}} | ||
# TODO: remove | ||
- name: authenticate with github for private go modules | ||
if: ${{github.event.repository.private}} | ||
uses: fusion-engineering/setup-git-credentials@v2 | ||
with: | ||
credentials: https://trajan0x:${{secrets.GIT_TOKEN }}@github.com/ | ||
|
||
# See if we need to rerun go generate | ||
# TODO: consider implementing https://github.com/golang/go/issues/20520 to sped up process if possible | ||
# ethergo generation is currently non-deterministic. TODO FIX" | ||
- name: Try Go Generate | ||
working-directory: ${{matrix.package}}/ | ||
if: ${{ !contains('ethergo', matrix.package) }} | ||
run: | | ||
go generate ./... | ||
|
@@ -321,15 +443,15 @@ jobs: | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 | ||
with: | ||
add-labels: 'needs-go-generate' | ||
add-labels: 'needs-go-generate-${{matrix.package}}' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ steps.find_pr.outputs.pr }} | ||
|
||
- name: Remove Label | ||
if: steps.verify-changed-files.outputs.files_changed != 'true' | ||
uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 | ||
with: | ||
remove-labels: 'needs-go-generate' | ||
remove-labels: 'needs-go-generate-${{matrix.package}}' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ steps.find_pr.outputs.pr }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.