Skip to content

Commit

Permalink
Fix release (#1128)
Browse files Browse the repository at this point in the history
* Fix: add cli2/lib/ to root .gitignore instead of nested as other way affects npm pack

* Add a .nvmrc file to normalize on a well known Node version

* Upgdate GitHub Actions builds to use LTS/Hydrogen (i.e. Node version 18.x)

* Update package-lock.json

* Slichtly improve error reporting in gulp build script.
  • Loading branch information
DamianReeves authored Dec 19, 2023
1 parent 61497bd commit 6fcaa38
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,51 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
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-
${{ runner.os }}-elm-
- name: Download dependencies
run: npm ci

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

- name: Running Test
run: npm test

# CVE scanning
# CVE scanning
cvescan:
name: CVE Scanning
runs-on: ubuntu-latest
needs: [ build ]
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand All @@ -76,7 +76,7 @@ jobs:
# Skip any PR created by dependabot to avoid permission issues
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: semgrep scan --config auto --severity ERROR
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ redistributable/Scala
cli/web/insightapp.js
cli/treeStuff.js
cli/index.html
cli2/lib/
lib/geneated
cadl-Frontend/cadl-output
Morphir.Elm.CLI.js
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/hydrogen
3 changes: 1 addition & 2 deletions cli2/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
morphir-elm.ts
package-lock.json
package.json
lib
package.json
8 changes: 5 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const buildMorphirAPI2 = async ()=>{
.pipe(dest('./lib/generated/morphir/sdk'))
return await execa('npx tsc', ['--project',path.join('.','lib','tsconfig.json')])
} catch (error) {
console.error("Error building morphir API 2", error);
return error
}

Expand Down Expand Up @@ -168,6 +169,7 @@ async function morphirJsonSchemaGen(inputPath, outputDir, target) {
try {
await execa('node', args, {stdio})
} catch (err) {
console.log("Error running json-schema-gen command", err);
throw(err)
}
}
Expand Down Expand Up @@ -295,7 +297,7 @@ async function testIntegrationBuildSpark(cb) {
)
} catch (err) {
if (err.code == 'ENOENT') {
console.log("Skipping testIntegrationBuildSpark as `mill` build tool isn't available.");
console.error("Skipping testIntegrationBuildSpark as `mill` build tool isn't available.");
} else {
throw err;
}
Expand All @@ -310,7 +312,7 @@ async function testIntegrationTestSpark(cb) {
)
} catch (err) {
if (err.code == 'ENOENT') {
console.log("Skipping testIntegrationTestSpark as `mill` build tool isn't available.");
console.error("Skipping testIntegrationTestSpark as `mill` build tool isn't available.");
} else {
throw err;
}
Expand Down Expand Up @@ -339,7 +341,7 @@ async function testCreateCSV(cb) {
} else {
code_no = shell.exec('bash ./create_csv_files.sh', { cwd: './tests-integration/spark/elm-tests/tests' }).code
if (code_no != 0) {
console.log('ERROR: CSV files cannot be created')
console.error('ERROR: CSV files cannot be created')
return false;
}
}
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

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

0 comments on commit 6fcaa38

Please sign in to comment.