Functionality updated #64
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: π Checkout | |
uses: actions/[email protected] | |
- name: π’ Install Node | |
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 Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Linux Variant | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute 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 ./lib/index.js | |
working-directory: ./components/hello-world | |
- name: Package Linux Variant | |
run: npm pack | |
working-directory: ./components/hello-world | |
- name: Publish 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: π Checkout | |
uses: actions/[email protected] | |
- name: π’ Install Node | |
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 Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Mac Variant | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute 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 ./lib/index.js | |
working-directory: ./components/hello-world | |
- name: Package Mac Variant | |
run: npm pack | |
working-directory: ./components/hello-world | |
- name: Publish 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: π Checkout | |
uses: actions/[email protected] | |
- name: π’ Install Node | |
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 Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Windows Variant | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute 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 ./lib/index.js | |
working-directory: ./components/hello-world | |
- name: Package Windows Variant | |
run: npm pack | |
working-directory: ./components/hello-world | |
- name: Publish 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 | |
steps: | |
- name: π Checkout | |
uses: actions/[email protected] | |
- name: π’ Install Node | |
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 Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Run Audit | |
run: npm audit | |
working-directory: ./components/hello-world | |