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

chore: add gas compare back #994

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
77 changes: 38 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ on:
types: [opened, synchronize]

jobs:

install_dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -110,43 +109,43 @@ jobs:
fail-on: high

# WIP can safely be ignored
# gasCompare:
# runs-on: ubuntu-latest
# needs: install_dependencies
# steps:
# - uses: bissolli/gh-action-persist-workspace@v1
# with:
# action: retrieve
# - name: Run GasCompare
# run: |
# if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
# BRANCH_NAME=$GITHUB_HEAD_REF
# else
# BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')
# fi
# echo "Current branch is $BRANCH_NAME"
# if [ "$BRANCH_NAME" == "master" ]; then
# echo "This is the master branch. Exiting..."
# exit 0
# fi
# CI=true npm run test
# mv ./gasReporterOutput.json /tmp/gasReporterOutput_Current.json
# git checkout master
# npm install
# CI=true npm run test
# mv ./gasReporterOutput.json /tmp/gasReporterOutput_Master.json

# - uses: bissolli/gh-action-persist-workspace@v1
# with:
# action: persist
gasCompare:
runs-on: ubuntu-latest
needs: install_dependencies
steps:
- uses: bissolli/gh-action-persist-workspace@v1
with:
action: retrieve
- name: Run GasCompare
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
BRANCH_NAME=$GITHUB_HEAD_REF
else
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')
fi
echo "Current branch is $BRANCH_NAME"
if [ "$BRANCH_NAME" == "main" ]; then
echo "This is the main branch. Exiting..."
exit 0
fi
CI=true npm run test
mv ./gasReporterOutput.json /tmp/gasReporterOutput_Current.json
git checkout main
npm install
CI=true npm run test
mv ./gasReporterOutput.json /tmp/gasReporterOutput_Main.json

# - name: Checkout
# uses: actions/checkout@v3
- uses: bissolli/gh-action-persist-workspace@v1
with:
action: persist

- name: Checkout
uses: actions/checkout@v3

# - uses: bissolli/gh-action-persist-workspace@v1
# with:
# action: retrieve
- uses: bissolli/gh-action-persist-workspace@v1
with:
action: retrieve

# - name: Run GasCompare
# run: |
# npm run gasCompare /tmp/gasReporterOutput_Current.json /tmp/gasReporterOutput_Master.json
- name: Run GasCompare
run: |
npm run gasCompare /tmp/gasReporterOutput_Current.json /tmp/gasReporterOutput_Main.json
4 changes: 2 additions & 2 deletions migrations/migrationHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const SOURCE = 'https://raw.githubusercontent.com/razor-network/datasources/mast

const getJobs = async () => {
try {
const jobs = await axios.get(`${SOURCE}/jobs.json`);
const jobs = await axios.get(`${SOURCE}/mainnet/jobs.json`);
return jobs.data;
} catch (error) {
console.log('Error while fetching jobs', error.response.body);
Expand All @@ -245,7 +245,7 @@ const getJobs = async () => {

const getCollections = async () => {
try {
const collections = await axios.get(`${SOURCE}/collections.json`);
const collections = await axios.get(`${SOURCE}/mainnet/collections.json`);
return collections.data;
} catch (error) {
console.log('Error while fetching collections', error.response.body);
Expand Down
Loading