Skip to content

CI Coverage #5

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

Merged
merged 5 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 39 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,53 @@

name: nodejs

on:
push:
pull_request:
paths:
- '**/**'
- '!**/docs/**'


env:
CI: true
FORCE_COLOR: 2


jobs:
build:
runs-on: ubuntu-latest
run:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: ['10', '12', '14']
node: ["10.x", "12.x", "14.x"]
os: ["ubuntu-latest"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.4
with:
node-version: ${{ matrix.node-version }}
- run: npm install


- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-


- name: npm install, build, and test
run: |
npm install
npm run ci
env:
CI: true
231 changes: 6 additions & 225 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,228 +1,9 @@
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# network security
/network-security.data


### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
node_modules
.nyc*
nyc*
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.coverage
coverage/
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env*.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

*.tar.gz
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
set -o errexit
export NODE_ENV='production'
export SOURCE_COMMIT="${SOURCE_COMMIT:-$(git rev-parse HEAD)}"

mkdir -p build
DIR="node_modules/.bin"
if [ -d "$DIR" ]; then
echo "Building Solidity Parser..."
echo "Parser SOURCE_COMMIT"
echo "SOURCE_COMMIT: $SOURCE_COMMIT"
sleep 1
rm -rf build/
mkdir -p build/
npx peggy --cache -o ./build/parser.js ./solidity.pegjs
npx peggy -o ./build/imports_parser.js ./imports.pegjs
echo "Geneated parser successfully"
exit 0
else
echo "Error: ${DIR} not found. Try installing with npm and not yarn"
echo "::error file=${DIR} not found. Try installing with npm and not yarn"
exit 1
fi
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
"prettier": "^2.3.2"
},
"scripts": {
"build": "sh entrypoint.sh",
"ci": "rm -rf build/ && sh entrypoint.sh && npx nyc --reporter=lcov npm test && npx codecov",
"build": "npx peggy --cache -o ./build/parser.js ./solidity.pegjs",
"compile": "npx peggy -o ./build/imports_parser.js ./imports.pegjs",
"ci": "./entrypoint.sh && npx nyc --reporter=lcov npm test && npx codecov",
"tracer": "./node_modules/.bin/peggy --trace --output parser-trace.js solidity.pegjs",
"lint": "npx eslint .",
"run": "npm run build && npm run compile",
"format": "npx prettier --config .prettierrc.json --write .",
"run": "npm run build",
"test": "npx mocha --timeout 5000 --reporter spec"
},
"repository": {
Expand Down
Loading