-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from CMTA/add-cli-workflow
Add cli workflow + nvm file for Node.JS
- Loading branch information
Showing
6 changed files
with
3,815 additions
and
7,060 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Truffle CI | ||
|
||
on: | ||
push: | ||
branches: [dev, master, main] | ||
pull_request: | ||
branches: [dev, master, main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup NodeJS 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.17.0 | ||
|
||
- name: Show NodeJS version | ||
run: npm --version | ||
|
||
- name: Checkout submodules | ||
run: git submodule update --init --recursive | ||
|
||
- name: Install Project Dependencies | ||
run: npm install | ||
|
||
- name: Run Truffle Test | ||
run: npx truffle test |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v16.17.0 |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ The toolchain includes the following components, where the versions | |
are the latest ones that we tested: | ||
|
||
- npm 8.19.2 | ||
- Truffle 5.8.3 | ||
- Truffle 5.9.3 | ||
- Solidity 0.8.17 (via solc-js) | ||
- Node 16.17.0 | ||
- Web3.js 1.9.0 | ||
|
@@ -18,12 +18,20 @@ Although present in the dependencies, Hardhat is not included in the toolchain s | |
|
||
## Installation | ||
|
||
- Clone the repository | ||
|
||
Clone the git repository, with the option `--recurse-submodules` to fetch the submodules: | ||
|
||
`git clone [email protected]:CMTA/CMTAT.git --recurse-submodules` | ||
|
||
- Node.js version | ||
|
||
We recommend to install the [Node Version Manager `nvm`](https://github.com/nvm-sh/nvm) to manage multiple versions of Node.js on your machine. You can then, for example, install the version 16.17.0 of Node.js with the following command: `nvm install 16.17.0` | ||
|
||
The file [.nvmrc](../.nvmrc) at the root of the project set the Node.js version. `nvm use`will automatically use this version if no version is supplied on the command line. | ||
|
||
- node modules | ||
|
||
To install the node modules required by CMTAT, run the following command at the root of the project: | ||
|
||
`npm install` | ||
|
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require('dotenv').config() | ||
|
||
const CMTAT_PROXY = artifacts.require("CMTAT_PROXY") | ||
const { deployProxy } = require("@openzeppelin/truffle-upgrades") | ||
const { Address } = require("ethereumjs-util") | ||
|
||
module.exports = async function (deployer, _network, account) { | ||
const admin = process.env.ADMIN_ADDRESS ? process.env.ADMIN_ADDRESS : account[0] | ||
const flag = 0 | ||
const ZERO_ADDRESS = Address.zero().toString() | ||
const proxyContract = await deployProxy( | ||
CMTAT_PROXY, | ||
[ | ||
admin, | ||
"Test CMTA Token", | ||
"TCMTAT", | ||
"TCMTAT_ISIN", | ||
"https://cmta.ch", | ||
ZERO_ADDRESS, | ||
"TCMTAT_info", | ||
flag, | ||
], | ||
{ | ||
deployer, | ||
constructorArgs: [ZERO_ADDRESS] | ||
} | ||
); | ||
await CMTAT_PROXY.deployed() | ||
console.log("Proxy deployed at: ", proxyContract.address) | ||
} |
Oops, something went wrong.