Skip to content

Commit

Permalink
Add pre-commit check in ci.feature (#1986)
Browse files Browse the repository at this point in the history
* workflow: lint-aways in ci.feature

* workflow: check-pre-commit for ci.feature

* lint packages/sdk-core/tasks/testSchemasAndQueries.sh

* workflow: fix ci.feature

* workflow: fix ci.feature

* workflow: fix ci.feature
  • Loading branch information
hellwolf authored Jul 10, 2024
1 parent ab300e3 commit 88370d5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/ci.feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:

runs-on: ubuntu-latest

defaults:
run:
shell: nix develop . -c bash -xe {0}

outputs:
build_solidity_semantic_money: ${{ env.BUILD_SOLIDITY_SEMANTIC_MONEY }}
build_ethereum_contracts: ${{ env.BUILD_ETHEREUM_CONTRACTS }}
Expand All @@ -28,6 +32,18 @@ jobs:
build_automation_contracts: ${{ env.BUILD_AUTOMATION_CONTRACTS }}

steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v19
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Initialize devShell
run: |
node --version
shellcheck --version
actionlint --version
- name: Show contexts
env:
HEAD_REF: ${{ github.head_ref }}
Expand All @@ -40,7 +56,8 @@ jobs:
echo github.head_ref: "$HEAD_REF"
echo github.base_ref: ${{ github.base_ref }}
- uses: actions/checkout@v4
- name: Run pre-commit check
run: npm run pre-commit

- name: Check changeset
run: tasks/check-changeset.sh ${{ github.sha }} dev
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"npmClient": "yarn",
"license": "MIT",
"scripts": {
"postinstall": "yarn git-submodule:init && husky install",
"postinstall": "npm run git-submodule:init && husky install",
"lint": "run-s lint:*",
"lint:shellcheck": "tasks/shellcheck-all-tasks.sh",
"lint:workspaces": "yarn workspaces run lint",
"lint:actionlint": "actionlint .github/workflows/*.yml",
"build": "yarn build-essentials #synonym of build-essentials",
"build": "npm run build-essentials #synonym of build-essentials",
"build-essentials": "set -ex;for i in metadata ethereum-contracts js-sdk sdk-core sdk-redux;do yarn workspace @superfluid-finance/$i build;done",
"build-for-contracts-dev": "set -ex;for i in metadata ethereum-contracts js-sdk;do yarn workspace @superfluid-finance/$i build;done",
"clean": "rm -rf node_modules; rm -rf packages/*/node_modules; yarn workspace @superfluid-finance/ethereum-contracts clean",
"test": "set -ex;for i in ethereum-contracts;do yarn workspace @superfluid-finance/$i test;done",
"show-versions": "lerna ls --long",
"pre-commit": "yarn lint:shellcheck && yarn workspaces run pre-commit",
"pre-commit": "npm run lint:shellcheck && npm run lint:actionlint && yarn workspaces run pre-commit",
"git-submodule:init": "git submodule update --init --recursive",
"git-submodule:update": "git submodule update --recursive",
"git-submodule:sync": "git submodule update --remote --recursive;git submodule sync --recursive",
Expand Down
9 changes: 0 additions & 9 deletions packages/sdk-core/tasks/testSchemasAndQueries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ function testSchemaAndQueries() {

# for sdk-core releases: test deployed subgraphs
for i in "${NETWORKS[@]}";do
# name mapping for subgraphs created before introducing canonical names
declare -A LEGACY_NETWORK_NAMES=(
["xdai-mainnet"]="xdai"
["polygon-mainnet"]="matic"
)

GRAPH_NETWORK="${LEGACY_NETWORK_NAMES[$i]:-$i}"

SUBGRAPH_ENDPOINT="https://subgraph-endpoints.superfluid.dev/$i/protocol-v1"

testSchemaAndQueries

done

0 comments on commit 88370d5

Please sign in to comment.