Skip to content

fix(ci): use official npm registry for pipeline deps #135

fix(ci): use official npm registry for pipeline deps

fix(ci): use official npm registry for pipeline deps #135

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
name: CI - node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v5
- name: set node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
- name: npm ci
run: npm ci
- name: npm test
run: npm test
azure-e2e:
name: Azure E2E
runs-on: ubuntu-latest
needs: test
if: >-
${{
github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/')
}}
env:
AZURE_DEVOPS_TOKEN_OPENUPM_PIPELINE: ${{ secrets.AZURE_DEVOPS_TOKEN_OPENUPM_PIPELINE }}
SOURCE_BRANCH: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
AZURE_E2E_ALLOW_MISSING_TOKEN: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- name: set node.js 22.x
uses: actions/setup-node@v5
with:
node-version: 22.x
- name: Check Azure PAT
id: azure-pat
run: |
if [ -z "${AZURE_DEVOPS_TOKEN_OPENUPM_PIPELINE:-}" ]; then
if [ "${AZURE_E2E_ALLOW_MISSING_TOKEN:-false}" != "true" ]; then
echo "AZURE_DEVOPS_TOKEN_OPENUPM_PIPELINE is required for Azure E2E in this repository."
exit 1
fi
echo "AZURE_DEVOPS_TOKEN_OPENUPM_PIPELINE is not configured; skipping Azure E2E."
echo "has_token=false" >> "$GITHUB_OUTPUT"
else
echo "has_token=true" >> "$GITHUB_OUTPUT"
fi
- name: npm ci
if: steps.azure-pat.outputs.has_token == 'true'
run: npm ci
- name: Run Azure git e2e fixture
if: steps.azure-pat.outputs.has_token == 'true'
run: |
node scripts/runAzureFixture.js \
--source-branch "$SOURCE_BRANCH" \
--repo-url "https://github.com/favoyang/com.example.nuget-consumer" \
--repo-branch "1.0.1" \
--package-name "com.example.nuget-consumer" \
--package-version "1.0.1" \
--package-source "git"
- name: Run Azure GitHub Release asset e2e fixture
if: steps.azure-pat.outputs.has_token == 'true'
env:
ASSET_URL: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/test/fixtures/assets/com.example.release-asset-1.0.0.tgz
run: |
node scripts/runAzureFixture.js \
--source-branch "$SOURCE_BRANCH" \
--repo-url "https://github.com/${{ github.repository }}" \
--repo-branch "${{ github.sha }}" \
--package-name "com.example.release-asset" \
--package-version "1.0.0" \
--package-source "githubRelease" \
--package-asset-url "$ASSET_URL" \
--package-asset-name "com.example.release-asset-1.0.0.tgz"