Skip to content

Updated Pipeline

Updated Pipeline #65

Workflow file for this run

name: XrmEx
on:
push:
pull_request:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
Prepare_and_Build:
runs-on: ubuntu-latest
outputs:
isMainRepo: ${{ steps.check-repo.outputs.isMainRepo }}
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v3
- run: npm ci
- name: Dependencies audit
run: npm audit --audit-level=moderate
- name: Build
run: npm run build
- name: Format check
run: npm run format:check
- name: Lint check
run: npm run lint:check
- name: Check Repository
id: check-repo
run: echo "::set-output name=isMainRepo::$(if [ "${{ github.repository }}" == "AhashSritharan/Xrm-Ex" ]; then echo true; else echo false; fi)"
Playwright_Test:
needs: Prepare_and_Build
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.39.0-jammy
steps:
- uses: actions/checkout@v3
- name: Run Playwright tests
run: |
if ${{ needs.Prepare_and_Build.outputs.isMainRepo }}; then
npx playwright test
else
npx playwright test contact.spec.ts
fi
env:
ENV_VAR_JSON: ${{ secrets.ENV_VAR_JSON }}
- name: Upload Playwright Report
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report/
retention-days: 30
Release_and_Upload:
needs: Playwright_Test
runs-on: ubuntu-latest
if: needs.Prepare_and_Build.outputs.isMainRepo == 'true'
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v3
- run: npm ci
- name: Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}