Skip to content

Commit

Permalink
gh actions: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wertikalk committed May 22, 2024
1 parent ec4ed5b commit 448eba0
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 117 deletions.
38 changes: 18 additions & 20 deletions .github/test-api-use/contracts/API-Inclusion.sol
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;

import {FilAddresses} from "filecoin-solidity-api/contracts/v0.8/utils/FilAddresses.sol";
import {CommonTypes} from "filecoin-solidity-api/contracts/v0.8/types/CommonTypes.sol";

import { FilAddresses } from "filecoin-solidity-api/contracts/v0.8/utils/FilAddresses.sol";
import { CommonTypes } from "filecoin-solidity-api/contracts/v0.8/types/CommonTypes.sol";
import {AccountTypes} from "filecoin-solidity-api/contracts/v0.8/types/AccountTypes.sol";
import {DataCapTypes} from "filecoin-solidity-api/contracts/v0.8/types/DataCapTypes.sol";
import {MarketTypes} from "filecoin-solidity-api/contracts/v0.8/types/MarketTypes.sol";
import {MinerTypes} from "filecoin-solidity-api/contracts/v0.8/types/MinerTypes.sol";
import {PowerTypes} from "filecoin-solidity-api/contracts/v0.8/types/PowerTypes.sol";
import {VerifRegTypes} from "filecoin-solidity-api/contracts/v0.8/types/VerifRegTypes.sol";

import { AccountTypes } from "filecoin-solidity-api/contracts/v0.8/types/AccountTypes.sol";
import { DataCapTypes } from "filecoin-solidity-api/contracts/v0.8/types/DataCapTypes.sol";
import { MarketTypes } from "filecoin-solidity-api/contracts/v0.8/types/MarketTypes.sol";
import { MinerTypes } from "filecoin-solidity-api/contracts/v0.8/types/MinerTypes.sol";
import { PowerTypes } from "filecoin-solidity-api/contracts/v0.8/types/PowerTypes.sol";
import { VerifRegTypes } from "filecoin-solidity-api/contracts/v0.8/types/VerifRegTypes.sol";

import { AccountAPI } from "filecoin-solidity-api/contracts/v0.8/AccountAPI.sol";
import { DataCapAPI } from "filecoin-solidity-api/contracts/v0.8/DataCapAPI.sol";
import { MarketAPI } from "filecoin-solidity-api/contracts/v0.8/MarketAPI.sol";
import { MinerAPI } from "filecoin-solidity-api/contracts/v0.8/MinerAPI.sol";
import { PowerAPI } from "filecoin-solidity-api/contracts/v0.8/PowerAPI.sol";
import { PrecompilesAPI } from "filecoin-solidity-api/contracts/v0.8/PrecompilesAPI.sol";
import { SendAPI } from "filecoin-solidity-api/contracts/v0.8/SendAPI.sol";
import { VerifRegAPI } from "filecoin-solidity-api/contracts/v0.8/VerifRegAPI.sol";
import {AccountAPI} from "filecoin-solidity-api/contracts/v0.8/AccountAPI.sol";
import {DataCapAPI} from "filecoin-solidity-api/contracts/v0.8/DataCapAPI.sol";
import {MarketAPI} from "filecoin-solidity-api/contracts/v0.8/MarketAPI.sol";
import {MinerAPI} from "filecoin-solidity-api/contracts/v0.8/MinerAPI.sol";
import {PowerAPI} from "filecoin-solidity-api/contracts/v0.8/PowerAPI.sol";
import {PrecompilesAPI} from "filecoin-solidity-api/contracts/v0.8/PrecompilesAPI.sol";
import {SendAPI} from "filecoin-solidity-api/contracts/v0.8/SendAPI.sol";
import {VerifRegAPI} from "filecoin-solidity-api/contracts/v0.8/VerifRegAPI.sol";

contract API_Inclusion {

//AccountAPI
function account_authenticate_message(CommonTypes.FilActorId target, AccountTypes.AuthenticateMessageParams memory params) public view {
AccountAPI.authenticateMessage(target, params);
}

//AddressAPI
function actorid_conversion() public pure {
function actorid_conversion() public pure {
uint64 actorID = 1;
CommonTypes.FilAddress memory result = FilAddresses.fromActorID(actorID);
}
Expand Down Expand Up @@ -67,7 +65,7 @@ contract API_Inclusion {
}

//VerifregAPI
function remove_expired_claims(
function remove_expired_claims(
VerifRegTypes.RemoveExpiredClaimsParams memory params
) public returns (int256, VerifRegTypes.RemoveExpiredClaimsReturn memory) {
VerifRegAPI.removeExpiredClaims(params);
Expand Down
62 changes: 31 additions & 31 deletions .github/test-api-use/package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"name": "fil-sol-use",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-ignition": "^0.15.4",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.0.0",
"@types/mocha": ">=9.1.0",
"chai": "^4.2.0",
"hardhat": "^2.22.4",
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.8.1",
"ts-node": ">=8.0.0",
"typechain": "^8.3.0",
"typescript": ">=4.5.0"
},
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^5.0.0"
}
"name": "fil-sol-use",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-ignition": "^0.15.4",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.0.0",
"@types/mocha": ">=9.1.0",
"chai": "^4.2.0",
"hardhat": "^2.22.4",
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.8.1",
"ts-node": ">=8.0.0",
"typechain": "^8.3.0",
"typescript": ">=4.5.0"
},
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^5.0.0"
}
}
9 changes: 4 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
container:
image: golang:1.21.7-bullseye
image: golang:1.21.7-bullseye

steps:

- name: Install node
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -49,9 +48,9 @@ jobs:

- name: Compilation
run: |
cd testing
rustup target add wasm32-unknown-unknown
cargo build
cd testing
rustup target add wasm32-unknown-unknown
cargo build
- name: Test-Account
run: cd testing && cargo test account -- --nocapture
Expand Down
76 changes: 38 additions & 38 deletions .github/workflows/publish-and-use.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: "Publish & use NPM package"

on:
release:
types:
- created
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: |
yarn install
make install_solc_linux
- name: Compile contract file
run: make
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: |
yarn install
make install_solc_linux
- name: Compile contract file
run: make
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}

lib-install-use:
runs-on: ubuntu-latest
needs: ["publish"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Checkout repo
uses: actions/checkout@main
with:
submodules: "true"
- name: Install from NPM registry
run: |
rm -rf hardhat.config.ts package.json
cd .github/test-api-use
yarn add filecoin-solidity-api
yarn install
npx hardhat compile
lib-install-use:
runs-on: ubuntu-latest
needs: ["publish"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Checkout repo
uses: actions/checkout@main
with:
submodules: "true"
- name: Install from NPM registry
run: |
rm -rf hardhat.config.ts package.json
cd .github/test-api-use
yarn add filecoin-solidity-api
yarn install
npx hardhat compile
40 changes: 17 additions & 23 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: "Security checks"
on:
push:
branches:
- dummy-feat
pull_request:
branches:
- master


jobs:
security-tests-part-1:
name: "API Security tests - part 1"
timeout-minutes: 30
runs-on: ubuntu-latest
steps:

- name: Install node
uses: actions/setup-node@v2
with:
Expand All @@ -36,57 +31,56 @@ jobs:
yarn install
- name: Install mythril
run: pip3 install mythril
run: pip3 install mythril

- name: Run checks on Account API
run: make security_account_api
run: make security_account_api

- name: Run checks on Market API
run: make security_market_api
run: make security_market_api

- name: Run checks on Miner API
run: make security_miner_api
run: make security_miner_api

- name: Run checks on VerifReg API
run: make security_verifreg_api
run: make security_verifreg_api

security-tests-part-2:
name: "API Security tests - part 2"
timeout-minutes: 30
runs-on: ubuntu-latest
steps:

- name: Install node
uses: actions/setup-node@v2
with:
node-version: "20.0.0"
node-version: "20.0.0"

- name: Install yarn
run: npm install -g yarn

- name: Checkout repo
uses: actions/checkout@main
with:
submodules: "true"
submodules: "true"

- name: Install other dependencies
run: |
sudo apt-get update
sudo apt-get -y install hwloc jq pkg-config bzr ocl-icd-opencl-dev
sudo apt install zsh -y
yarn install
sudo apt-get update
sudo apt-get -y install hwloc jq pkg-config bzr ocl-icd-opencl-dev
sudo apt install zsh -y
yarn install
- name: Install mythril
run: pip3 install mythril
run: pip3 install mythril

- name: Run checks on Power API
run: make security_power_api
run: make security_power_api

- name: Run checks on Datacap API
run: make security_datacap_api
run: make security_datacap_api

- name: Run checks on Send API
run: make security_send_api
run: make security_send_api

- name: Run checks on Precompiles API
run: make security_precompiles_api
run: make security_precompiles_api

0 comments on commit 448eba0

Please sign in to comment.