Skip to content
Open
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
88 changes: 62 additions & 26 deletions .github/workflows/nodejs-ci.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,73 @@
# CI for command line NodeJS Applications
name: nodejs
name: CI

on:
push:
paths:
- "**/**"
- "!**/*.md/**"

env:
CI: true
FORCE_COLOR: 2
branches:
- master
pull_request:

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

strategy:
fail-fast: false
matrix:
node: ["14"]
os: ["ubuntu-latest"]
build-test-verify:
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@v2.3.4
- name: Record start time
id: record_time
run: |
echo "BUILD_START=$(date +%s)" >> $GITHUB_ENV

- name: Set up Node.js
uses: actions/setup-node@v2.1.5
- name: Checkout repository
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup_node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: 16

- name: Install npm dependencies
- name: Cache node modules
id: cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
id: install_deps
run: npm install

- name: Run build
run: npm run ci
- name: Run tests
id: test
run: npm test

- name: Package and Verify VSCode Theme
id: package
run: npx vsce package

- name: Post PR Comment with Build Time and Test Success
if: github.event_name == 'pull_request'
id: post_comment
uses: actions/github-script@v6
with:
script: |
// Get the start time from the environment variable
const buildStart = parseInt(process.env.BUILD_START);
const buildEnd = Math.floor(Date.now() / 1000);
const buildDuration = buildEnd - buildStart;
const commentBody = `✅ Build succeeded in ${buildDuration} seconds. All tests passed.`;
// Extract PR number from the GITHUB_REF (e.g. refs/pull/123/merge)
const prNumberMatch = process.env.GITHUB_REF.match(/refs\/pull\/(\d+)\/merge/);
if (prNumberMatch) {
const prNumber = parseInt(prNumberMatch[1], 10);
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: commentBody
});
} else {
console.log("Not a pull request event. No comment posted.");
}
125 changes: 124 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"publisher": "ContractShark",
"icon": "assets/icon.png",
"license": "MIT",
"version": "1.6.0",
"version": "2.0.0",
"engines": {
"vscode": "^1.67.0"
"vscode": "^1.74.0"
},
"keywords": [
"solidity",
Expand Down Expand Up @@ -39,8 +39,11 @@
"ui",
"workspace"
],
"activationEvents": [
"onLanguage:solidity"
],
"scripts": {
"ci": "npm i -g vsce && npm run build",
"ci": "npm i -g @vscode/vsce && npm run build",
"build": "npx vsce package -o dist/",
"test": "npx ajv-cli test -s tests/tmLanguage.schema.json -d syntaxes/solidity.tmLanguage.json --valid"
},
Expand Down Expand Up @@ -124,10 +127,11 @@
},
"devDependencies": {
"@vscode/test-web": "^0.0.33",
"@vscode/vsce": "^2.16.0",
"@vscode/vsce": "^3.2.2",
"ajv": "8.11.2",
"ajv-cli": "5.0.0",
"prettier": "2.8.1",
"vsce": "2.15.0"
"vscode-textmate": "^9.2.0",
"vscode-tmgrammar-test": "^0.1.3"
}
}
86 changes: 86 additions & 0 deletions syntaxes/gaes.tmLanguage.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
// @see {@link https://github.com/fjl/geas}
"name": "Geas",
"scopeName": "source.geas",
"fileTypes": ["geas"],
"patterns": [
// Comments
{
"name": "comment.line.double-semicolon.geas",
"match": ";;.*$"
},
// Strings
{
"name": "string.quoted.double.geas",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.geas",
"match": "\\\\|\\\""
}
]
},
// Expression Macros
{
"name": "keyword.function.expression-macro.geas",
"match": "%\\b(abs|selector|keccak256|address)\\b"
},
// Instruction Macros
{
"name": "keyword.function.instruction-macro.geas",
"match": "%\\b(include|assemble|push)\\b"
},
// Labels
{
"name": "entity.name.label.geas",
"match": "^\\w+:$"
},
// Environment Opcodes
{
"name": "keyword.control.environment.geas",
"match": "\\b(address|balance|origin|caller|callvalue|calldataload|calldatasize|calldatacopy|codesize|codecopy|gasprice|returndatasize|returndatacopy|blockhash|coinbase|timestamp|number|difficulty|gaslimit|chainid|selfbalance|basefee)\\b"
},
// Trie Opcodes
{
"name": "keyword.control.trie.geas",
"match": "\\b(extcodesize|extcodecopy|extcodehash|sload|sstore|selfdestruct)\\b"
},
// Call Opcodes
{
"name": "keyword.control.call.geas",
"match": "\\b(create|call|callcode|delegatecall|create2|staticcall)\\b"
},
// Push Constants - Decimal
{
"name": "constant.numeric.decimal.geas",
"match": "\\b\\d+\\b"
},
// Push Constants - Hexadecimal
{
"name": "constant.numeric.hexadecimal.geas",
"match": "\\b0x[0-9a-fA-F]+\\b"
},
// Push Constants - Binary
{
"name": "constant.numeric.binary.geas",
"match": "\\b0b[01]+\\b"
},
// Push Constants - Octal
{
"name": "constant.numeric.octal.geas",
"match": "\\b0o[0-7]+\\b"
},
// Regular Opcodes
{
"name": "keyword.operator.arithmetic.geas",
"match": "\\b(stop|add|mul|sub|div|sdiv|mod|smod|addmod|mulmod|exp|signextend|lt|gt|slt|sgt|eq|iszero|and|or|xor|not|byte|shl|shr|sar|keccak256|pop|mload|mstore|mstore8|jump|jumpi|pc|msize|gas|jumpdest|revert|invalid|return)\\b"
},
// Stack Manipulation Opcodes (swap, dup, log)
{
"name": "keyword.operator.stack-manipulation.geas",
"match": "\\b(swap[1-6]|dup[1-6]|log[0-4])\\b"
}
],
"uuid": "56D1D69F-5E8C-4FBA-8B21-95F9B343D3B4"
}
Loading
Loading