Merge pull request #71 #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build-And-Test-Component" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- components/hello-world/** | |
- .github/workflows/Build-And-Test-Component.yml | |
pull_request: | |
branches: | |
- main | |
paths: | |
- components/hello-world/** | |
- .github/workflows/Build-And-Test-Component.yml | |
jobs: | |
hello-world-linux: | |
name: "Hello-World Linux" | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Get Repository | |
uses: actions/[email protected] | |
- name: π’ Install Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
always-auth: true | |
node-version: 18 | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org | |
- name: Install Preprocessor | |
run: npm install -g c-preprocessor | |
- name: Prepare and Execute Preprocessor | |
run: | | |
python prepareExecutePreprocessor.py | |
env: | |
COMPONENT: hello-world | |
VARIANT_TYPE: LINUX | |
- name: Install Hello-World Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Hello-World Linux Variant | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute Hello-World Variant Tests | |
run: npm run test | |
working-directory: ./components/hello-world | |
# # This step was added to show the output | |
# - name: Execute Variant (Demo Purposes) | |
# run: node ./output/Variant.js | |
# working-directory: ./components/hello-world | |
- name: Package Hello-World Linux Variant | |
run: npm pack | |
working-directory: ./components/hello-world | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
- name: Publish Hello-World Linux Variant | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world-linux | |
path: ./components/hello-world/naveed235812-hello-world-linux-*.tgz | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch'}} | |
hello-world-mac: | |
name: "Hello-World Mac" | |
runs-on: macos-latest | |
steps: | |
- name: π Get Repository | |
uses: actions/[email protected] | |
- name: π’ Install Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
always-auth: true | |
node-version: 18 | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org | |
- name: Install Preprocessor | |
run: npm install -g c-preprocessor | |
- name: Prepare and Execute Preprocessor | |
run: | | |
python prepareExecutePreprocessor.py | |
env: | |
COMPONENT: hello-world | |
VARIANT_TYPE: MAC | |
- name: Install Hello-World Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Hello-World Mac Variant | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute Hello-World Variant Tests | |
run: npm run test | |
working-directory: ./components/hello-world | |
# # This step was added to show the output | |
# - name: Execute Variant (Demo Purposes) | |
# run: node ./output/Variant.js | |
# working-directory: ./components/hello-world | |
- name: Package Hello-World Mac Variant | |
run: npm pack | |
working-directory: ./components/hello-world | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
- name: Publish Hello-World Mac Variant | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world-mac | |
path: ./components/hello-world/naveed235812-hello-world-mac-*.tgz | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
hello-world-windows: | |
name: "Hello-World Windows" | |
runs-on: windows-latest | |
steps: | |
- name: π Get Repository | |
uses: actions/[email protected] | |
- name: π’ Install Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
always-auth: true | |
node-version: 18 | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org | |
- name: Install Preprocessor | |
run: npm install -g c-preprocessor | |
- name: Prepare and Execute Preprocessor | |
run: | | |
python prepareExecutePreprocessor.py | |
env: | |
COMPONENT: hello-world | |
VARIANT_TYPE: WINDOWS | |
- name: Install Hello-World Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Hello-World Windows Variant | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute Hello-World Variant Tests | |
run: npm run test | |
working-directory: ./components/hello-world | |
# # This step was added to show the output | |
# - name: Execute Variant (Demo Purposes) | |
# run: node ./output/Variant.js | |
# working-directory: ./components/hello-world | |
- name: Package Hello-World Windows Variant | |
run: npm pack | |
working-directory: ./components/hello-world | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
- name: Publish Hello-World Windows Variant | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world-windows | |
path: ./components/hello-world/naveed235812-hello-world-windows-*.tgz | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
security-scan: | |
needs: | |
- hello-world-linux | |
- hello-world-mac | |
- hello-world-windows | |
name: "Security Scan" | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' }} | |
steps: | |
- name: π Get Repository | |
uses: actions/[email protected] | |
- name: π’ Install Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
always-auth: true | |
node-version: 18 | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org | |
- name: Install Preprocessor | |
run: npm install -g c-preprocessor | |
- name: Prepare and Execute Preprocessor | |
run: | | |
python prepareExecutePreprocessor.py | |
env: | |
COMPONENT: hello-world | |
VARIANT_TYPE: LINUX | |
- name: Install Hello-World Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Execute Audit | |
run: npm audit | |
working-directory: ./components/hello-world | |