NPS Survey Form #2689
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: PullRequest | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: | |
- main | |
- 'release/stable' | |
- 'features/PowerPagesAgent' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ windows-latest, macos-latest, ubuntu-latest ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Delete node_modules (manual cleanup on Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
if (Test-Path node_modules) { rd /S /Q node_modules } | |
shell: powershell | |
- name: Delete node_modules (manual cleanup on Unix) | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
if [ -d node_modules ]; then rm -rf node_modules; fi | |
shell: bash | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Configure .npmrc for Azure Artifacts on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
echo "@gia:registry=https://msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/" > $env:USERPROFILE\.npmrc | |
echo "always-auth=true" >> $env:USERPROFILE\.npmrc | |
echo "//msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/:username=${{ secrets.AZURE_DEVOPS_USERNAME }}" >> $env:USERPROFILE\.npmrc | |
echo "//msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/:_password=$(echo -n ${{ secrets.AZURE_DEVOPS_READ_PAT }} | base64)" >> $env:USERPROFILE\.npmrc | |
echo "//msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/:email=${{ secrets.AZURE_DEVOPS_EMAIL }}" >> $env:USERPROFILE\.npmrc | |
shell: pwsh | |
- name: Configure .npmrc for Azure Artifacts on Unix | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
echo "@gia:registry=https://msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/" > ~/.npmrc | |
echo "always-auth=true" >> ~/.npmrc | |
echo "//msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/:username=${{ secrets.AZURE_DEVOPS_USERNAME }}" >> ~/.npmrc | |
echo "//msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/:_password=$(echo -n ${{ secrets.AZURE_DEVOPS_READ_PAT }} | base64)" >> ~/.npmrc | |
echo "//msazure.pkgs.visualstudio.com/One/_packaging/BAP_GIA_Survey_Feed/npm/registry/:email=${{ secrets.AZURE_DEVOPS_EMAIL }}" >> ~/.npmrc | |
shell: bash | |
- name: Build and unit test | |
run: | | |
npm ci | |
npm run dist | |
env: | |
AZURE_DEVOPS_READ_PAT: ${{ secrets.AZURE_DEVOPS_READ_PAT }} | |
- name: Run integration tests | |
uses: coactions/setup-xvfb@v1 | |
with: | |
run: | | |
npm run test-integration | |
npm run test-web-integration |