Skip to content
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

Ci restoration take3 #1187

Closed
Closed
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
87 changes: 87 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# building project
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [22.8.0]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

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

- name: Cache Elm
uses: actions/cache@v3
with:
path: ~/.elm
key: ${{ runner.os }}-elm-${{ hashFiles('**/elm.json') }}
restore-keys: |
${{ runner.os }}-elm-

- name: New NPM version
run: |
majorVersion=$(node -v | cut -d. -f1 | cut -d'v' -f2)
npm i -g npm --prefix=/usr/local/opt/node@$majorVersion

- name: Download dependencies
run: npm ci

- name: Build
run: npm run build --if-present

- name: Running Test
run: npm test

# CVE scanning
cvescan:
name: CVE Scanning
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npx --yes auditjs ossi --whitelist allow-list.json

# Semgrep static code analysis
semgrep:
name: Semgrep
runs-on: ubuntu-latest
needs: [cvescan]
container:
# A Docker image with Semgrep installed. Don't change this.
image: returntocorp/semgrep
# Skip any PR created by dependabot to avoid permission issues
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v4
- run: semgrep scan --config auto --severity ERROR
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dist
.vscode
.idea
.metals/
morphir-ir.json
morphir-hashes.json
morphir-test-coverage.json
generated/
Expand All @@ -26,3 +25,7 @@ tests-integration/reference-model/Dockerfile
*Debug.log*
tests-integration/cli2-qa-test/test-data/.DS_Store
tests-integration/cli2-qa-test/test-data/business-terms/.DS_Store
tests-integration/typespec/model/morphir-ir.json
tests-integration/json-schema/model/morphir-ir.json
tests-integration/reference-model/morphir-ir.json
/morphir-ir.json
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
22.8.0
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ root directory with the following structure:
{
"name": "My.Package",
"sourceDirectory": "src",
"dependencies" : ["a", "b"]
"localDependencies" : ["a", "b"]
"exposedModules": [
"Foo",
"Bar"
Expand All @@ -82,7 +84,12 @@ root directory with the following structure:
* **name** - The name of the package. The package name should be a valid Elm module name and it should be used as a
module prefix in your Elm models. If your package name is `My.Package` all your module files should either be directly
under that or in submodules.

* **sourceDirectory** - The directory where your Elm sources are located.
* **dependencies** - List of URI references to other IR files. Supports
`file://`|`http://`|`https://`|`data://` protocols.
* **localDependencies** - List of relative paths to depending IRs. (for backwards compatibility), ex: `"../sibling-folder/morphir-ir.json"`

* **exposedModules** - The list of modules in the public interface of the package. Module names should exclude the
common package prefix. In the above example `Foo` refers to the Elm module `My.Package.Foo`.

Expand Down
3 changes: 3 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
4 changes: 1 addition & 3 deletions cli2/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
node_modules
morphir-elm.ts
package-lock.json
package.json
morphir-elm.ts
3 changes: 1 addition & 2 deletions cli2/config-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ This file serves as the entrypoint for Json Schema Backend configuration process
*/
import * as fs from "fs";
import * as path from 'path';
import * as util from 'util'
import cli from "./cli";
import * as util from 'util';

const fsReadFile = util.promisify(fs.readFile);
const configFilePath: string = "JsonSchema.config.json";
Expand Down
6 changes: 6 additions & 0 deletions cli2/package-lock.json

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

3 changes: 3 additions & 0 deletions cli2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
9 changes: 5 additions & 4 deletions elm-tooling.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"tools": {
"elm": "0.19.1",
"elm-format": "0.8.5",
"elm-json": "0.2.13"
"elm": "0.19.1",
"elm-format": "0.8.7",
"elm-json": "0.2.13",
"elm-test-rs": "3.0.0"
}
}
}
Loading
Loading