Skip to content

Commit

Permalink
Update package.json to allow reading env values from .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
swarup-n committed Jan 25, 2024
1 parent 2b69370 commit 5b1ff35
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 193 deletions.
48 changes: 24 additions & 24 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 4
labels:
- "type:maintenance"
- "dependencies"
ignore:
- dependency-name: "@playwright/test" #We have to source the playwright container which is not detected by Dependabot
- dependency-name: "playwright-core" #We have to source the playwright container which is not detected by Dependabot
- dependency-name: "@babel/eslint-parser" #Lots of noise in these type patch releases.
update-types: ["version-update:semver-patch"]
- dependency-name: "eslint-plugin-vue" #Lots of noise in these type patch releases.
update-types: ["version-update:semver-patch"]
# version: 2
# updates:
# - package-ecosystem: "npm"
# directory: "/"
# schedule:
# interval: "daily"
# open-pull-requests-limit: 4
# labels:
# - "type:maintenance"
# - "dependencies"
# ignore:
# - dependency-name: "@playwright/test" #We have to source the playwright container which is not detected by Dependabot
# - dependency-name: "playwright-core" #We have to source the playwright container which is not detected by Dependabot
# - dependency-name: "@babel/eslint-parser" #Lots of noise in these type patch releases.
# update-types: ["version-update:semver-patch"]
# - dependency-name: "eslint-plugin-vue" #Lots of noise in these type patch releases.
# update-types: ["version-update:semver-patch"]

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "type:maintenance"
- "dependencies"
# - package-ecosystem: "github-actions"
# directory: "/"
# schedule:
# interval: "daily"
# labels:
# - "type:maintenance"
# - "dependencies"
84 changes: 42 additions & 42 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
name: npm install, build, and lint
# name: npm install, build, and lint

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 18.x]
openmct-version:
- latest
- stable
timeout-minutes: 10
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run build:example based on openmct-version
run: |
if [ "${{ matrix.openmct-version }}" = "latest" ]; then
npm run build:example:master
elif [ "${{ matrix.openmct-version }}" = "stable" ]; then
npm run build:example
fi
# jobs:
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [20.x, 18.x]
# openmct-version:
# - latest
# - stable
# timeout-minutes: 10
# continue-on-error: true
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm install
# - name: Run build:example based on openmct-version
# run: |
# if [ "${{ matrix.openmct-version }}" = "latest" ]; then
# npm run build:example:master
# elif [ "${{ matrix.openmct-version }}" = "stable" ]; then
# npm run build:example
# fi

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm install
- name: Run lint
run: npm run lint
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js 20.x
# uses: actions/setup-node@v4
# with:
# node-version: 20.x
# - run: npm install
# - name: Run lint
# run: npm run lint
22 changes: 22 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Create package on push to release branch

on:
push:
branches: [ release ]

workflow_dispatch:

jobs:
build:
runs-on: self-hosted

steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.11.0'

- name: npm ci
- name: npm prepare
234 changes: 117 additions & 117 deletions .github/workflows/yamcs-quickstart-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,118 +1,118 @@
name: "yamcs-quickstart-e2e"
on:
workflow_dispatch:
pull_request:
types:
- labeled
- opened
schedule:
- cron: "0 0 * * 1-5"
push:
branches:
- master
# name: "yamcs-quickstart-e2e"
# on:
# workflow_dispatch:
# pull_request:
# types:
# - labeled
# - opened
# schedule:
# - cron: "0 0 * * 1-5"
# push:
# branches:
# - master

jobs:
yamcs-quickstart-e2e:
if: ${{ github.event.label.name == 'pr:e2e:quickstart' }} || ${{ github.event.action == 'opened' }}
timeout-minutes: 10
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
yamcs-version:
- default
- 5.8.3 #viper
## disabling until we get confirmation- 5.3.2 #ab
openmct-version:
- latest
- stable
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: "18"
- uses: actions/checkout@v3
with:
repository: yamcs/quickstart
ref: master
path: 'quickstart'
- name: replace yamcsVersion with matrix param
if: matrix.yamcs-version != 'default'
run: |
cd quickstart
mvn -B versions:set-property -Dproperty=yamcsVersion -DnewVersion=${{ matrix.yamcs-version }}
- name: trigger make all from docker dir. Orphan and redirect output to docker/makeout.txt
run: |
cd quickstart/docker
touch makeout.txt
make all &> makeout.txt &
- run: npm install
- name: Run build:example based on openmct-version
run: |
if [ "${{ matrix.openmct-version }}" = "latest" ]; then
npm run build:example:master
elif [ "${{ matrix.openmct-version }}" = "stable" ]; then
npm run build:example
fi
- run: npx playwright@1.39.0 install chromium
- name: Get Open MCT e2e tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: npm run test:getopensource
- name: Check that yamcs is available
run: |
docker ps -a
npm run wait-for-yamcs
- name: Check Yamcs installed version
run: |
response=$(curl -s -w "%{http_code}" -o yamcs_version.json http://localhost:8090/api/)
if [ "$response" -eq 200 ]; then
cat yamcs_version.json | jq '.yamcsVersion'
else
echo "Error: Unable to fetch Yamcs version. HTTP status code: $response"
exit 1
fi
- name: Run Quickstart tests
run: npm run test:e2e:quickstart
- name: Capture docker logs to file
if: always()
run: docker logs yamcs > yamcs-docker-log.txt 2>&1
- name: archive docker logs
if: always()
uses: actions/upload-artifact@v3
with:
path: yamcs-docker-log.txt
- name: Archive makeout.txt
if: always()
uses: actions/upload-artifact@v3
with:
path: /quickstart/docker/makeout.txt
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
with:
path: test-results
- name: Archive html test results
if: always()
uses: actions/upload-artifact@v3
with:
path: tests/html-test-results
- name: Remove pr:e2e:quickstart label (if present)
if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e:quickstart') }}
uses: actions/github-script@v6
with:
script: |
const { owner, repo, number } = context.issue;
const labelToRemove = 'pr:e2e:quickstart';
try {
await github.rest.issues.removeLabel({
owner,
repo,
issue_number: number,
name: labelToRemove
});
} catch (error) {
core.warning(`Failed to remove 'pr:e2e:quickstart' label: ${error.message}`);
}
# jobs:
# yamcs-quickstart-e2e:
# if: ${{ github.event.label.name == 'pr:e2e:quickstart' }} || ${{ github.event.action == 'opened' }}
# timeout-minutes: 10
# runs-on: ubuntu-latest
# continue-on-error: true
# strategy:
# matrix:
# yamcs-version:
# - default
# - 5.8.3 #viper
# ## disabling until we get confirmation- 5.3.2 #ab
# openmct-version:
# - latest
# - stable
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v4
# with:
# node-version: "18"
# - uses: actions/checkout@v3
# with:
# repository: yamcs/quickstart
# ref: master
# path: 'quickstart'
# - name: replace yamcsVersion with matrix param
# if: matrix.yamcs-version != 'default'
# run: |
# cd quickstart
# mvn -B versions:set-property -Dproperty=yamcsVersion -DnewVersion=${{ matrix.yamcs-version }}
# - name: trigger make all from docker dir. Orphan and redirect output to docker/makeout.txt
# run: |
# cd quickstart/docker
# touch makeout.txt
# make all &> makeout.txt &
# - run: npm install
# - name: Run build:example based on openmct-version
# run: |
# if [ "${{ matrix.openmct-version }}" = "latest" ]; then
# npm run build:example:master
# elif [ "${{ matrix.openmct-version }}" = "stable" ]; then
# npm run build:example
# fi
# - run: npx playwright@1.39.0 install chromium
# - name: Get Open MCT e2e tests
# uses: nick-fields/retry@v2
# with:
# timeout_minutes: 10
# max_attempts: 3
# command: npm run test:getopensource
# - name: Check that yamcs is available
# run: |
# docker ps -a
# npm run wait-for-yamcs
# - name: Check Yamcs installed version
# run: |
# response=$(curl -s -w "%{http_code}" -o yamcs_version.json http://localhost:8090/api/)
# if [ "$response" -eq 200 ]; then
# cat yamcs_version.json | jq '.yamcsVersion'
# else
# echo "Error: Unable to fetch Yamcs version. HTTP status code: $response"
# exit 1
# fi
# - name: Run Quickstart tests
# run: npm run test:e2e:quickstart
# - name: Capture docker logs to file
# if: always()
# run: docker logs yamcs > yamcs-docker-log.txt 2>&1
# - name: archive docker logs
# if: always()
# uses: actions/upload-artifact@v3
# with:
# path: yamcs-docker-log.txt
# - name: Archive makeout.txt
# if: always()
# uses: actions/upload-artifact@v3
# with:
# path: /quickstart/docker/makeout.txt
# - name: Archive test results
# if: always()
# uses: actions/upload-artifact@v3
# with:
# path: test-results
# - name: Archive html test results
# if: always()
# uses: actions/upload-artifact@v3
# with:
# path: tests/html-test-results
# - name: Remove pr:e2e:quickstart label (if present)
# if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e:quickstart') }}
# uses: actions/github-script@v6
# with:
# script: |
# const { owner, repo, number } = context.issue;
# const labelToRemove = 'pr:e2e:quickstart';
# try {
# await github.rest.issues.removeLabel({
# owner,
# repo,
# issue_number: number,
# name: labelToRemove
# });
# } catch (error) {
# core.warning(`Failed to remove 'pr:e2e:quickstart' label: ${error.message}`);
# }
Loading

0 comments on commit 5b1ff35

Please sign in to comment.