feat: update contracts #117
Workflow file for this run
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
name: Continuous Integration | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
lint_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Setup environment | |
uses: ./.github/actions/setup | |
- name: Run formatter | |
run: yarn format:check | |
- name: Run linter | |
run: yarn lint | |
- name: Run unit tests | |
run: yarn test | |
modify_dependency_graph: | |
needs: lint_and_test | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create and run dependency modification script | |
run: | | |
cat << EOF > modify-dependencies.js | |
const fs = require('fs'); | |
const path = require('path'); | |
const dependencyGraphFile = path.join(process.env.GITHUB_WORKSPACE, 'dependency-graph.json'); | |
if (!fs.existsSync(dependencyGraphFile)) { | |
console.error('dependency-graph.json does not exist'); | |
process.exit(1); | |
} | |
const graph = JSON.parse(fs.readFileSync(dependencyGraphFile, 'utf8')); | |
graph.forEach(dep => { | |
if (dep.name === '@erc6900/reference-implementation') { | |
dep.package_url = \`pkg:github/erc6900/reference-implementation@\${dep.version.split('#')[1]}\`; | |
dep.license = 'MIT'; | |
} | |
}); | |
fs.writeFileSync(dependencyGraphFile, JSON.stringify(graph, null, 2)); | |
console.log('Dependency graph modified successfully'); | |
EOF | |
node modify-dependencies.js | |
- name: Upload modified dependency graph | |
uses: actions/upload-artifact@v3 | |
with: | |
name: modified-dependency-graph | |
path: dependency-graph.json | |
scan: | |
needs: modify_dependency_graph | |
if: github.event_name == 'pull_request' | |
uses: circlefin/circle-public-github-workflows/.github/workflows/pr-scan.yaml@v1 |