Skip to content

Commit

Permalink
Merge pull request #1 from unchain-tech/patch-test
Browse files Browse the repository at this point in the history
Patch test
  • Loading branch information
neila authored Feb 23, 2024
2 parents fe50477 + e187b52 commit c7148dc
Show file tree
Hide file tree
Showing 8 changed files with 15,159 additions and 19,899 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on: workflow_call

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'yarn'
- uses: actions/cache@v4
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable

check:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: lint
run: yarn lint
- name: format
run: yarn prettier:check
43 changes: 2 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,5 @@ name: CI
on: [push]

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'yarn'
- uses: actions/cache@v4
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable

check:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: lint
run: yarn lint
- name: format
run: yarn prettier:check

contract-test:
runs-on: ubuntu-latest
needs: [setup, check]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: integration_test
run: yarn workspace contract test
ci:
uses: ./.github/workflows/_ci.yml
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test

on: [pull_request]

jobs:
ci:
uses: ./.github/workflows/_ci.yml

contract-test:
runs-on: ubuntu-latest
needs: ci
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: integration_test
run: yarn workspace contract test
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const buildLintCommand = (filenames) =>
`eslint ${filenames.map((f) => path.relative(process.cwd(), f)).join(' ')}`;

const buildSolhintCommand = (filenames) =>
`solhint --max-warnings 0 -c packages/contract/.solhint.json --ignore-path .gitignore ${filenames
`solhint -c packages/contract/.solhint.json --ignore-path .gitignore ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(' ')} `;

Expand Down
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
"source.fixAll.eslint": "explicit"
},
"solidity.packageDefaultDependenciesDirectory": "node_modules",
}
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright © 2024 UNCHAIN

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{
"name": "UNCHAIN-passports-V2",
"name": "unchain-nfts",
"version": "1.0.0",
"description": "UNCHAIN passport NFT contract",
"license": "UNLICENSED",
"description": "NFT contracts issued for provenance of completing UNCHAIN projects",
"license": "MIT",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/shiftbase-inc/UNCHAIN-passports-V2.git"
"url": "git+https://github.com/unchain-tech/passport-nfts.git"
},
"bugs": {
"url": "https://github.com/shiftbase-inc/UNCHAIN-passports-V2/issues"
"url": "https://github.com/unchain-tech/passport-nfts/issues"
},
"author": "SHØ <[email protected]> (http://akxra.art/)",
"author": "neila <[email protected]> (https://github.com/neila/)",
"contributors": [
"SHØ <[email protected]> (http://akxra.art/)",
"yk-saito <[email protected]> (https://github.com/yk-saito)",
"honganji <[email protected]> (https://github.com/honganji)"
"neila <[email protected]> (https://github.com/neila/)",
"yk-saito <[email protected]> (https://github.com/yk-saito)"
],
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
Expand Down Expand Up @@ -48,8 +47,8 @@
"client:dev": "cp -r ./packages/contract/typechain-types ./packages/client/types/typechain-types && yarn workspace client dev",
"prettier": "prettier --ignore-unknown --no-error-on-unmatched-pattern --ignore-path .prettierignore --write .",
"prettier:check": "prettier --ignore-unknown --no-error-on-unmatched-pattern --ignore-path .prettierignore --check .",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"lint": "eslint . && yarn contract solhint",
"lint:fix": "eslint --fix . && yarn contract solhint:fix",
"test": "yarn workspace contract test"
}
}
Loading

0 comments on commit c7148dc

Please sign in to comment.