Build-And-Test-Component-CI #2
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-CI" | |
# Run this action on every push to master branch | |
on: | |
workflow_dispatch: # To manually run the job | |
push: | |
branches: | |
- main | |
paths: | |
- components/hello-world/** | |
# pull_request: | |
# branches: | |
# - main | |
jobs: | |
component-linux: | |
name: "Linux Variant" | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Checkout | |
uses: actions/[email protected] | |
- name: π’ Node | |
uses: actions/setup-node@v3 | |
with: | |
always-auth: true | |
node-version: '12.18.2' | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org | |
- name: Install C-Preprocessor | |
run: npm install -g c-preprocessor | |
- name: Prepare and Execute C-Preprocessor | |
run: | | |
python prepareVariantConfig.py | |
working-directory: ./components/hello-world | |
env: | |
VARIANT_TYPE: LINUX | |
# - name: Execute C-Preprocessor | |
# run: | | |
# npm install c-preprocessor -g | |
# echo example of c-preprocessor | |
# c-preprocessor ./src/Main.ts ./src/Main.ts | |
# working-directory: ./components/hello-world | |
- name: Install Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Component | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute Tests | |
run: npm run test | |
working-directory: ./components/hello-world | |
- name: Execute Linux Variant | |
run: node ./lib/index.js | |
working-directory: ./components/hello-world | |
- name: Package Component | |
run: npm pack | |
working-directory: ./components/hello-world | |
- name: Publish LINUX Component | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world-LINUX | |
path: ./components/hello-world/naveed235812-hello-world-LINUX-*.tgz | |
component-mac: | |
name: "Mac Variant" | |
runs-on: macos-latest | |
steps: | |
- name: π Checkout | |
uses: actions/[email protected] | |
- name: π’ Node | |
uses: actions/setup-node@v3 | |
with: | |
always-auth: true | |
node-version: '12.18.2' | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org | |
- name: Install C-Preprocessor | |
run: npm install -g c-preprocessor | |
- name: Prepare and Execute C-Preprocessor | |
run: | | |
python preparevarientConfig.py | |
working-directory: ./components/hello-world | |
env: | |
VARIANT_TYPE: MAC | |
# - name: Execute C-Preprocessor | |
# run: | | |
# npm install c-preprocessor -g | |
# echo example of c-preprocessor | |
# c-preprocessor ./src/Main.ts ./src/Main.ts | |
# working-directory: ./components/hello-world | |
- name: Install Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Component | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute Tests | |
run: npm run test | |
working-directory: ./components/hello-world | |
- name: Execute Mac Varient | |
run: node ./lib/index.js | |
working-directory: ./components/hello-world | |
- name: Package Component | |
run: npm pack | |
working-directory: ./components/hello-world | |
- name: Publish MAC Component | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world-MAC | |
path: ./components/hello-world/naveed235812-hello-world-MAC-*.tgz | |
component-windows: | |
name: "Windows Variant" | |
runs-on: windows-latest | |
steps: | |
- name: π Checkout | |
uses: actions/[email protected] | |
- name: π’ Node | |
uses: actions/setup-node@v3 | |
with: | |
always-auth: true | |
node-version: '12.18.2' | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org | |
- name: Install C-Preprocessor | |
run: npm install -g c-preprocessor | |
- name: Prepare and Execute C-Preprocessor | |
run: | | |
python .\preparevarientConfig.py | |
working-directory: ./components/hello-world | |
env: | |
VARIANT_TYPE: WINDOWS | |
# - name: Execute C-Preprocessor | |
# run: | | |
# npm install c-preprocessor -g | |
# echo example of c-preprocessor | |
# c-preprocessor ./src/Main.ts ./src/Main.ts | |
# working-directory: ./components/hello-world | |
- name: Install Dependencies | |
run: npm install | |
working-directory: ./components/hello-world | |
- name: Build Component | |
run: npm run build | |
working-directory: ./components/hello-world | |
- name: Execute Tests | |
run: npm run test | |
working-directory: ./components/hello-world | |
- name: Execute Windows Varient | |
run: node ./lib/index.js | |
working-directory: ./components/hello-world | |
- name: Package Component | |
run: npm pack | |
working-directory: ./components/hello-world | |
- name: Publish Windows Component | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world-WINDOWS | |
path: ./components/hello-world/naveed235812-hello-world-WINDOWS-*.tgz | |
check-compatibility-with-windows-product: | |
needs: | |
- component-windows | |
name: "Product Basic Variant (Windows)" | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Variant_Basic | |
uses: actions/checkout@v4 | |
with: | |
repository: naveedkhan8067/Varient_Basic | |
token: ${{ secrets.ACCESS_TOKEN_GITHUB }} | |
path: Varient_Basic | |
- name: π’ Download Windows Component | |
uses: actions/download-artifact@v4 | |
with: | |
name: hello-world-WINDOWS | |
- name: Display Root | |
run: | | |
dir | |
- name: π’ Node | |
uses: actions/setup-node@v3 | |
with: | |
always-auth: true | |
node-version: '12.18.2' | |
scope: '@naveed235812' | |
registry-url: https://registry.npmjs.org |