Skip to content

Commit

Permalink
Merge pull request #3 from TeslaGov/CKM-3009/clara
Browse files Browse the repository at this point in the history
Rebase for Mage Upgrade 6.2.12
  • Loading branch information
OGRoomService authored Sep 30, 2024
2 parents 19c2dc8 + d932671 commit 8a5c129
Show file tree
Hide file tree
Showing 1,241 changed files with 242,090 additions and 91,086 deletions.
59 changes: 0 additions & 59 deletions .eslintrc.js

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Build and Run Tests

on: [push]
on:
push:
branches-ignore:
- 'no-ci-*'
- 'wip-*'
- 'x-*'

jobs:
build:
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/build_test.service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: build and test service

on:
workflow_dispatch:
workflow_call:
push:
paths:
- service/**
- plugins/**
- .github/workflows/build_test.service.yaml
- .github/workflows/config.yaml

jobs:
config:
uses: ./.github/workflows/config.yaml
build:
name: build mage service
needs: config
runs-on: ubuntu-latest
steps:
- name: install system libs
run: |
sudo apt-get install build-essential
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ needs.config.outputs.node_versions-latest }}
cache: npm
cache-dependency-path: |
service/npm-shrinkwrap.json
plugins/nga-msi/package-lock.json
plugins/image/service/package-lock.json
- name: build service
run: |
cd service
npm ci
npm run build
- name: pack service
run: npm pack ./service
- name: build plugin nga-msi
run: |
cd plugins/nga-msi
npm ci
npm run build
npm test
- name: pack nga-msi
run: npm pack ./plugins/nga-msi
- name: build plugin image.service
run: |
cd plugins/image/service
npm ci
npm run build
npm test
- name: pack plugin image.service
run: npm pack ./plugins/image/service
- name: upload packages
uses: actions/upload-artifact@v3
with:
name: mage_service_packages
path: |
ngageoint-mage.*.tgz
test:
name: test mage service
needs: [ config, build ]
runs-on: ubuntu-latest
strategy:
matrix:
node: ${{ fromJSON(needs.config.outputs.node_versions-all-json) }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: |
service/npm-shrinkwrap.json
- name: install service dependencies
run: |
npm ci --prefix service
- name: download service package
uses: actions/download-artifact@v3
with:
name: mage_service_packages
- name: extract service lib
run: |
tar xzf $(ls -1 ngageoint-mage.service-*.tgz) package/lib
mv package/lib ./service
rmdir package
- name: test service with node ${{ matrix.node }}
run: |
cd service
npm run ci:test
# TODO: restore coveralls test coverage report - see buildAndTest.yml
47 changes: 47 additions & 0 deletions .github/workflows/build_test.web-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build and test web-app

on:
workflow_dispatch:
workflow_call:
push:
paths:
- web-app/**
- .github/workflows/build_test.web-app.yaml
- .github/workflows/config.yaml

jobs:
config:
uses: ./.github/workflows/config.yaml
main:
name: build mage web app
needs: config
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
# TODO: angular 9 build does not run on node > 14
node-version: 14
cache: npm
cache-dependency-path: web-app/package-lock.json
- name: build
run: |
cd web-app
npm ci
npm run build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- name: test
run: npm run --prefix web-app ci:test
- name: pack
run: |
npm pack ./web-app/dist/core-lib
npm pack ./web-app/dist/app
- name: upload packages
uses: actions/upload-artifact@v3
with:
name: mage_web-app_packages
path: |
ngageoint-mage.*.tgz
57 changes: 57 additions & 0 deletions .github/workflows/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: build configuration

on:
workflow_call:
outputs:
node_versions-all:
value: ${{ jobs.main.outputs.node_versions-all }}
node_versions-all-json:
value: ${{ jobs.main.outputs.node_versions-all-json }}
node_versions-latest:
value: ${{ jobs.main.outputs.node_versions-latest }}
node_versions-pre_latest:
value: ${{ jobs.main.outputs.node_versions-pre_latest }}
node_versions-pre_latest-json:
value: ${{ jobs.main.outputs.node_versions-pre_latest-json }}

env:
MAGE_NODE_VERSIONS: 16 18 20

jobs:

main:
runs-on: ubuntu-latest
outputs:
node_versions-all: ${{ steps.node_versions.outputs.all }}
node_versions-all-json: ${{ steps.node_versions.outputs.all-json }}
node_versions-latest: ${{ steps.node_versions.outputs.latest }}
node_versions-pre_latest: ${{ steps.node_versions.outputs.pre_latest }}
node_versions-pre_latest-json: ${{ steps.node_versions.outputs.pre_latest-json }}
steps:
- id: sort_node_versions
name: sort versions
run: |
echo 'node_versions_lines<<EOF' >> $GITHUB_ENV
echo ${MAGE_NODE_VERSIONS} | tr ' ' '\n' | sort -V >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- id: node_versions
name: main
run: |
node_versions_arr=($(echo "${node_versions_lines}"))
node_versions_latest=${node_versions_arr[-1]}
node_versions_pre_latest=${node_versions_arr[@]:0:${#node_versions_arr[@]}-1}
node_versions_pre_latest=(${node_versions_arr[@]:0:-1})
node_versions_json=$(printf '"%s",' ${node_versions_arr[@]})
node_versions_json="[ ${node_versions_json:0:-1} ]"
node_versions_pre_latest_json=$(printf '"%s",' ${node_versions_pre_latest[@]})
node_versions_pre_latest_json="[ ${node_versions_pre_latest_json:0:-1} ]"
echo "node versions arr: ${node_versions_arr[@]}"
echo "node versions json: ${node_versions_json}"
echo "node versions latest: ${node_versions_latest}"
echo "node versions pre_latest: ${node_versions_pre_latest}"
echo "node versions pre_latest json: ${node_versions_pre_latest_json}"
echo all=${node_versions_arr} >> $GITHUB_OUTPUT
echo all-json=${node_versions_json} >> $GITHUB_OUTPUT
echo latest=${node_versions_latest} >> $GITHUB_OUTPUT
echo pre_latest=${node_versions_pre_latest} >> $GITHUB_OUTPUT
echo pre_latest-json=${node_versions_pre_latest_json} >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/createRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Archive
run: |
cd ..
tar czf mage_${{steps.get_version.outputs.VERSION}}_node${{matrix.node}}_${{env.FRIENDLY_OS}}.tar.gz mage-server --transform s/mage-server/mage_${{steps.get_version.outputs.VERSION}}_node${{matrix.node}}_${{env.FRIENDLY_OS}}/
tar czf mage_${{steps.get_version.outputs.VERSION}}_node${{matrix.node}}_${{env.FRIENDLY_OS}}.tar.gz --exclude-vcs --transform s/mage-server/mage_${{steps.get_version.outputs.VERSION}}_node${{matrix.node}}_${{env.FRIENDLY_OS}}/ mage-server
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
Loading

0 comments on commit 8a5c129

Please sign in to comment.