use caching

pull/3668/head^2
filip mertens 2 years ago
parent d05eefa45c
commit 76d9774a05
  1. 10
      .circleci/config.yml
  2. 2
      apps/remix-ide/.gitignore
  3. 15
      apps/remix-ide/ci/download_e2e_assets.js

@ -28,9 +28,9 @@ jobs:
name: Build
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build:production
NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build:production
else
NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build
NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build
fi
- run: yarn run build:e2e
@ -39,7 +39,11 @@ jobs:
keys:
- soljson-{{ checksum "soljson-versions.txt" }}
- run: yarn run downloadsolc_assets_e2e
- save_cache:
keys:
- soljson-{{ checksum "soljson-versions.txt" }}
paths:
- dist/apps/remix-ide/assets/js/soljson
- run: mkdir persist && zip -0 -r persist/dist.zip dist
- persist_to_workspace:

@ -13,4 +13,4 @@ TODO
.tern-port
temp_publish_docker
src/assets/version.json
src/assets/js/soljson-v*
src/assets/js/soljson/soljson-v*

@ -4,7 +4,7 @@ var child_process = require('child_process');
const axios = require('axios');
const { exit } = require('process');
var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true });
var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true });
if (child.error) {
console.log("ERROR: ", child);
@ -22,14 +22,17 @@ if (soljson) {
url = `https://binaries.soliditylang.org/bin/soljson${version}.js`;
const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`;
const dir = './dist/apps/remix-ide/assets/js/soljson';
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
const path = `./dist/apps/remix-ide/assets/js/soljson/soljson${version}.js`;
// check if the file exists
const exists = fs.existsSync(path);
if (!exists) {
console.log(url)
// use axios to get the file
try {
/*
axios({
method: 'get',
url: url,
@ -39,7 +42,9 @@ if (soljson) {
console.log(err);
}
})
})*/
}).catch(function (error) {
console.log(error);
})
} catch (e) {
console.log('Failed to download soljson' + version + ' from ' + url)
}

Loading…
Cancel
Save