Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Play with workflows #41

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/node_modules
**/.cache
**/cache
**/public
**/build
File renamed without changes.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c78b15d93f74d1f32b262d86848b4a9b1e43a4d4
20 changes: 17 additions & 3 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,35 @@ defaults:
jobs:
core-format:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v4

- name: Set up Node
- name: Set up Node in root
uses: actions/setup-node@v4
with:
node-version-file: "./.nvmrc"
cache: "yarn"
cache-dependency-path: "./yarn.lock"

- name: Set up Node in core package
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"

- name: Install Dependencies
- name: Install Dependencies in root
run: yarn install --prefer-offline --frozen-lockfile

- name: Install Dependencies in core package
working-directory: ./core
run: yarn install --prefer-offline --frozen-lockfile

- name: Format
run: yarn format
run: yarn format -w core

core-build:
runs-on: ubuntu-latest
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Website

on:
push:
branches:
- main
paths:
- "website/**"
pull_request:
paths:
- "website/**"

defaults:
run:
working-directory: ./website

jobs:
core-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node in root
uses: actions/setup-node@v4
with:
node-version-file: "./.nvmrc"
cache: "yarn"
cache-dependency-path: "./yarn.lock"

- name: Install Dependencies in root
run: cd .. && yarn install --prefer-offline --frozen-lockfile

- name: Set up Node in website package
uses: actions/setup-node@v4
with:
node-version-file: "website/.nvmrc"
cache: "yarn"
cache-dependency-path: "website/yarn.lock"

- name: Install Dependencies in website package
run: yarn install --prefer-offline --frozen-lockfile

- name: Make the script file executable
run: cd .. && chmod +x lint.sh

- name: Format
run: cd .. && yarn format -w website
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/node_modules
**/yarn-debug.log*
**/yarn-error.log*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/iron
36 changes: 27 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
repos:
- repo: local
hooks:
- id: lint-sol
- id: core-lint-sol
name: "lint core sol"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:sol"
files: '\.sol$'
entry: /usr/bin/env bash -c "npm run lint:sol -- -w core"
files: ^core/
types: [solidity]
language: script
description: "Checks solidity code according to the package's linter configuration"
- id: lint-js
- id: core-lint-js
name: "lint core ts/js"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:js"
files: '\.(ts|js)$'
entry: /usr/bin/env bash -c "npm run lint:js -- -w core"
files: ^core/
types_or: [ts,javascript]
language: script
description: "Checks TS/JS code according to the package's linter configuration"
- id: lint-config
- id: core-lint-config
name: "lint core json/yaml"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:config"
files: '\.(json|yaml)$'
entry: /usr/bin/env bash -c "npm run lint:config -- -w core"
files: ^core/
types_or: [json,yaml]
language: script
description: "Checks JSON/YAML code according to the package's linter configuration"
# Website
- id: website-lint-js
name: "lint website ts/js"
entry: /usr/bin/env bash -c "npm run lint:js -- -w website"
files: ^website/
types_or: [ts,tsx,javascript,jsx]
language: script
description: "Checks TS/JS code according to the package's linter configuration"
- id: website-lint-config
name: "lint website json/yaml"
entry: /usr/bin/env bash -c "npm run lint:config -- -w website"
files: ^website/
types_or: [json,yaml]
language: script
description: "Checks JSON/YAML code according to the package's linter configuration"
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions .tsconfig-eslint.json
6 changes: 0 additions & 6 deletions core/.eslintignore

This file was deleted.

17 changes: 10 additions & 7 deletions core/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"root": true,
"extends": ["@thesis-co"],
"rules": {
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": ["hardhat.config.ts", "test/**"] }
]
}
"extends":["../.eslintrc"],
"overrides": [
{
"files": ["hardhat.config.ts", "test/**"],
"rules": {
"semi": "error",
"import/no-extraneous-dependencies": "off"
}
}
]
}
Empty file removed core/.git-blame-ignore-revs
Empty file.
6 changes: 0 additions & 6 deletions core/.prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion core/.solhintignore

This file was deleted.

2 changes: 1 addition & 1 deletion core/deploy/01_deploy_acre.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HardhatRuntimeEnvironment } from "hardhat/types"
import type { DeployFunction } from "hardhat-deploy/types"

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments } = hre
const { log } = deployments

Expand Down
14 changes: 0 additions & 14 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
"clean": "hardhat clean && rm -rf cache/ export/ export.json",
"build": "hardhat compile",
"deploy": "hardhat deploy --export export.json",
"format": "npm run lint:js && npm run lint:sol && npm run lint:config",
"format:fix": "npm run lint:js:fix && npm run lint:sol:fix && npm run lint:config:fix",
"lint:js": "eslint .",
"lint:js:fix": "eslint . --fix",
"lint:sol": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
"lint:sol:fix": "solhint 'contracts/**/*.sol' --fix && prettier --write 'contracts/**/*.sol'",
"lint:config": "prettier --check '**/*.@(json)'",
"lint:config:fix": "prettier --write '**/*.@(json)'",
"test": "hardhat test"
},
"devDependencies": {
Expand All @@ -35,22 +27,16 @@
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@openzeppelin/hardhat-upgrades": "^2.3.3",
"@thesis-co/eslint-config": "^0.6.1",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.2.0",
"@types/mocha": ">=9.1.0",
"@types/node": ">=16.0.0",
"chai": "^4.3.10",
"eslint": "^8.51.0",
"ethers": "^6.8.0",
"hardhat": "^2.18.2",
"hardhat-deploy": "^0.11.43",
"hardhat-gas-reporter": "^1.0.8",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3",
"solhint": "^3.6.2",
"solhint-config-thesis": "github:thesis/solhint-config",
"solidity-coverage": "^0.8.0",
"ts-node": "^10.9.1",
"typechain": "^8.3.2",
Expand Down
Loading
Loading