Skip to content

CI/CD #86

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
86 changes: 86 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI/CD Pipeline

on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- main
jobs:
build:
name: "CI/CD"
runs-on: defi-dex-linux-medium
environment: testnet
permissions:
contents: write

strategy:
matrix:
node-version: ['20.x']

env:
RPC_URL: ${{ secrets.RPC_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}

- name: Install Yarn
run: npm install --global yarn

- name: Cache Yarn Dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.cache/yarn
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn install

- name: Compile
run: yarn run compile

- name: Run Tests
run: yarn run test

- name: Extract and publish ABIs
run: |
mkdir -p data/abis
find ./artifacts/contracts -type f -name "*.json" ! -name "*.dbg.json" -exec cp {} data/abis/ \;

- name: Import GPG Key
id: gpg_importer
uses: step-security/ghaction-import-gpg@6c8fe4d0126a59d57c21f87c9ae5dd3451fa3cca # v6.1.0
with:
git_commit_gpgsign: true
git_tag_gpgsign: true
git_user_signingkey: ${{ secrets.GPG_KEY_ID }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Add & Commit
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
cwd: "."
author_name: ${{ secrets.AUTOCOMMIT_GIT_USER_NAME }}
author_email: ${{ secrets.AUTOCOMMIT_GIT_USER_EMAIL }}
commit: --signoff
message: "chore: extract ABI files [autocomit]"
push: true
53 changes: 0 additions & 53 deletions .github/workflows/push.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/push_main.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/release.yml

This file was deleted.

13 changes: 6 additions & 7 deletions contracts/buildings/BuildingFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ contract BuildingFactory is BuildingFactoryStorage, Initializable {
address building,
address token,
uint256 reserveAmount,
uint256 nPercentage,
uint32 cliff,
uint32 unlockDuration
uint256 nPercentage
) external onlyBuildingOwner(building) {
BuildingFactoryStorageData storage $ = _getBuildingFactoryStorage();

Expand All @@ -176,7 +174,7 @@ contract BuildingFactory is BuildingFactoryStorage, Initializable {
);

address treasury = _deployTreasury(reserveAmount, nPercentage, msg.sender);
address vault = _deployVault(token, msg.sender, treasury, cliff, unlockDuration);
address vault = _deployVault(token, msg.sender, treasury);

ITreasury(treasury).addVault(vault);

Expand Down Expand Up @@ -225,9 +223,7 @@ contract BuildingFactory is BuildingFactoryStorage, Initializable {
function _deployVault(
address token,
address initialOwner,
address vaultRewardController,
uint32 cliff,
uint32 unlockDuration
address vaultRewardController
) private returns (address) {
BuildingFactoryStorageData storage $ = _getBuildingFactoryStorage();

Expand All @@ -238,6 +234,9 @@ contract BuildingFactory is BuildingFactoryStorage, Initializable {
string memory tokenName = IERC20Metadata(token).name();
string memory tokenSymbol = IERC20Metadata(token).symbol();

uint32 cliff = 0;
uint32 unlockDuration = 0;

IVaultFactory.VaultDetails memory vaultDetails = IVaultFactory.VaultDetails(
token, // address stakingToken;
tokenName, // string shareTokenName;
Expand Down
2 changes: 1 addition & 1 deletion data/abis/Bits.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "Bits",
"sourceName": "contracts/erc4626/BasicVault.sol",
"sourceName": "contracts/buildings/library/BuildingToken.sol",
"abi": [],
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220535edc8eb730b818806218a35e7cf9b147dce9ffabfcf502a43e252e01de001d64736f6c63430008180033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220535edc8eb730b818806218a35e7cf9b147dce9ffabfcf502a43e252e01de001d64736f6c63430008180033",
Expand Down
Loading