Commit 172f04fa by Francisco Giordano

Add initial transpiler setup

parent fdfca7f7
name: Transpile
on:
push:
branches: [upstream-patched]
jobs:
transpile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 10.x
- uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-
- run: npm ci
- run: bash scripts/transpile.sh
const { BuidlerError } = require('@nomiclabs/buidler/internal/core/errors');
extendEnvironment(env => {
const { artifacts } = env;
env.artifacts = {
...artifacts,
require (name) {
try {
return artifacts.require(name + 'UpgradeSafeWithInit');
} catch (e) {
if (BuidlerError.isBuidlerError(e) && e.number === 700) {
return artifacts.require(name + 'UpgradeSafe');
} else {
throw e;
}
}
},
};
});
const { internalTask } = require('@nomiclabs/buidler/config');
const { TASK_TEST_GET_TEST_FILES } = require('@nomiclabs/buidler/builtin-tasks/task-names');
const glob = require('glob');
const path = require('path');
const { promisify } = require('util');
internalTask(TASK_TEST_GET_TEST_FILES)
.setAction(async ({ testFiles }, { config }) => {
if (testFiles.length !== 0) {
return testFiles;
}
return await promisify(glob)(
path.join(config.paths.tests, '**/*.js'),
{ ignore: [path.join(config.paths.tests, 'proxy/**/*')] },
);
});
#!/usr/bin/env bash
set -euo pipefail -x
npm run compile
npx @openzeppelin/upgrade-safe-transpiler -D
COMMIT="$(git rev-parse --short HEAD)"
git config user.name 'github-actions'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add contracts
git reset --soft master
git checkout master
git commit -m "Transpile $COMMIT"
git push origin master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment