name: Main workflow on: pull_request: push: branches: - main - releases/* jobs: build: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 - name: Set Node.js 12 uses: actions/setup-node@v1 with: node-version: 12.x - run: npm ci - run: npm run build - run: npm run format-check - run: npm test - name: Verify no unstaged changes if: runner.os != 'windows' run: __tests__/verify-no-unstaged-changes.sh test: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 - name: Clear tool cache (macOS) if: runner.os == 'macos' run: | echo $PATH dotnet --info rm -rf "/Users/runner/.dotnet" - name: Clear tool cache (Ubuntu) if: runner.os == 'linux' run: | echo $PATH dotnet --info rm -rf "/usr/share/dotnet" - name: Clear tool cache (Windows) if: runner.os == 'windows' run: | echo $env:PATH dotnet --info Remove-Item $env:LocalAppData\Microsoft\dotnet/* -Recurse -Force -ErrorAction SilentlyContinue Remove-Item "$env:ProgramFiles\dotnet/*" -Recurse -Force -ErrorAction SilentlyContinue # Side-by-side install of 2.2 and 3.1 used for the test project - name: Setup dotnet 2.2.402 uses: ./ with: dotnet-version: 2.2.402 - name: Setup dotnet 3.1.201 uses: ./ with: dotnet-version: 3.1.201 # We are including this veriable to force the generation of the nuget config file to verify that it is created in the correct place source-url: https://api.nuget.org/v3/index.json env: NUGET_AUTH_TOKEN: NOTATOKEN - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1.201 2.2.402 - name: Verify dotnet (Windows) if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1.201 test-proxy: runs-on: ubuntu-latest container: image: mcr.microsoft.com/dotnet/core/runtime-deps:3.0-bionic options: --dns 127.0.0.1 services: squid-proxy: image: datadog/squid:latest ports: - 3128:3128 env: https_proxy: http://squid-proxy:3128 http_proxy: http://squid-proxy:3128 steps: - name: Checkout uses: actions/checkout@v2 - name: Clear tool cache run: rm -rf "/usr/share/dotnet" - name: Install curl run: | apt update apt -y install curl - name: Setup dotnet 3.1.201 uses: ./ with: dotnet-version: 3.1.201 source-url: https://api.nuget.org/v3/index.json env: NUGET_AUTH_TOKEN: NOTATOKEN - name: Verify dotnet run: __tests__/verify-dotnet.sh 3.1.201 test-bypass-proxy: runs-on: ubuntu-latest env: https_proxy: http://no-such-proxy:3128 no_proxy: github.com,dotnetcli.blob.core.windows.net,download.visualstudio.microsoft.com,api.nuget.org,dotnetcli.azureedge.net steps: - name: Checkout uses: actions/checkout@v2 - name: Clear tool cache run: rm -rf "/usr/share/dotnet" - name: Setup dotnet 3.1.201 uses: ./ with: dotnet-version: 3.1.201 source-url: https://api.nuget.org/v3/index.json env: NUGET_AUTH_TOKEN: NOTATOKEN - name: Verify dotnet run: __tests__/verify-dotnet.sh 3.1.201