2019-07-12 03:22:28 +07:00
|
|
|
name: Main workflow
|
2020-01-26 13:37:54 +07:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2021-02-03 14:59:17 +07:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-01-26 13:37:54 +07:00
|
|
|
push:
|
|
|
|
branches:
|
2020-07-16 00:00:26 +07:00
|
|
|
- main
|
2020-01-26 13:37:54 +07:00
|
|
|
- releases/*
|
2021-02-03 14:59:17 +07:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-01-26 13:37:54 +07:00
|
|
|
|
2019-07-12 03:22:28 +07:00
|
|
|
jobs:
|
2020-01-26 13:37:54 +07:00
|
|
|
build:
|
2019-07-12 03:22:28 +07:00
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
strategy:
|
2020-09-15 23:36:09 +07:00
|
|
|
fail-fast: false
|
2019-07-12 03:22:28 +07:00
|
|
|
matrix:
|
2021-02-04 22:26:17 +07:00
|
|
|
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
2019-07-26 09:59:29 +07:00
|
|
|
steps:
|
2019-07-24 00:22:11 +07:00
|
|
|
- name: Checkout
|
2020-01-26 13:37:54 +07:00
|
|
|
uses: actions/checkout@v2
|
2022-02-24 15:16:01 +07:00
|
|
|
- name: Set Node.js 16
|
2020-01-26 13:37:54 +07:00
|
|
|
uses: actions/setup-node@v1
|
2019-07-12 03:22:28 +07:00
|
|
|
with:
|
2022-02-24 15:16:01 +07:00
|
|
|
node-version: 16.x
|
|
|
|
cache: npm
|
2020-01-26 13:37:54 +07:00
|
|
|
- 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
|
2021-11-23 17:03:56 +07:00
|
|
|
|
|
|
|
test-setup-multiple-versions:
|
|
|
|
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 toolcache
|
|
|
|
shell: pwsh
|
|
|
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
|
|
|
- name: Setup dotnet 2.2.402 and 3.1.404
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
dotnet-version: |
|
|
|
|
2.2.402
|
|
|
|
3.1.404
|
|
|
|
3.0.x
|
|
|
|
- name: Verify dotnet
|
|
|
|
shell: pwsh
|
|
|
|
run: __tests__/verify-dotnet.ps1 2.2.402 3.1.404 '3.0'
|
2019-07-12 03:22:28 +07:00
|
|
|
|
2021-02-04 13:27:28 +07:00
|
|
|
test-setup-full-version:
|
2020-01-26 13:37:54 +07:00
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
strategy:
|
2020-09-15 23:36:09 +07:00
|
|
|
fail-fast: false
|
2020-01-26 13:37:54 +07:00
|
|
|
matrix:
|
2021-02-04 22:26:17 +07:00
|
|
|
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
2020-01-26 13:37:54 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-02-04 13:19:10 +07:00
|
|
|
- name: Clear toolcache
|
2021-02-03 18:37:15 +07:00
|
|
|
shell: pwsh
|
2021-02-04 13:19:10 +07:00
|
|
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
2020-09-15 23:36:09 +07:00
|
|
|
# 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
|
2020-01-26 13:37:54 +07:00
|
|
|
uses: ./
|
|
|
|
with:
|
2020-09-15 23:36:09 +07:00
|
|
|
dotnet-version: 3.1.201
|
2020-09-03 01:11:56 +07:00
|
|
|
# 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
|
2021-02-04 13:57:09 +07:00
|
|
|
- name: Verify nuget config file
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2021-02-04 14:36:14 +07:00
|
|
|
if (-Not (Test-Path "../nuget.config")) { throw "nuget file not generated correctly" }
|
2020-01-26 13:37:54 +07:00
|
|
|
- name: Verify dotnet
|
2021-02-04 15:43:20 +07:00
|
|
|
shell: pwsh
|
2020-09-24 22:26:00 +07:00
|
|
|
run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402
|
|
|
|
|
2021-02-04 13:27:28 +07:00
|
|
|
test-setup-without-patch-version:
|
2021-02-04 13:19:10 +07:00
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-02-04 22:26:17 +07:00
|
|
|
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
2021-02-04 13:19:10 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Clear toolcache
|
2021-02-03 19:40:37 +07:00
|
|
|
shell: pwsh
|
2021-02-04 13:19:10 +07:00
|
|
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
|
|
|
# 2.0, 3.0, 5.0 needs to be in single quotes to interpret as a string instead of as an integer
|
2021-02-03 19:40:37 +07:00
|
|
|
- name: Setup dotnet '3.1'
|
2020-09-24 22:26:00 +07:00
|
|
|
uses: ./
|
|
|
|
with:
|
2021-02-03 19:40:37 +07:00
|
|
|
dotnet-version: '3.1'
|
2021-02-04 15:49:04 +07:00
|
|
|
- name: Setup dotnet '2.2'
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
dotnet-version: '2.2'
|
2021-02-03 19:40:37 +07:00
|
|
|
- name: Verify dotnet
|
2021-02-04 15:43:20 +07:00
|
|
|
shell: pwsh
|
2021-02-04 15:49:04 +07:00
|
|
|
run: __tests__/verify-dotnet.ps1 3.1 2.2
|
2021-02-04 13:19:10 +07:00
|
|
|
|
2021-02-04 18:33:49 +07:00
|
|
|
test-setup-latest-patch-version:
|
2021-02-04 13:19:10 +07:00
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-02-04 22:26:17 +07:00
|
|
|
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
2021-02-04 13:19:10 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Clear toolcache
|
2021-02-03 19:54:50 +07:00
|
|
|
shell: pwsh
|
2021-02-04 13:19:10 +07:00
|
|
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
2021-02-03 19:54:50 +07:00
|
|
|
- name: Setup dotnet 3.1.x
|
2020-09-24 22:26:00 +07:00
|
|
|
uses: ./
|
|
|
|
with:
|
2021-02-03 19:54:50 +07:00
|
|
|
dotnet-version: 3.1.x
|
2021-02-04 15:49:04 +07:00
|
|
|
- name: Setup dotnet 2.2.x
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
dotnet-version: 2.2.x
|
2021-02-03 19:54:50 +07:00
|
|
|
- name: Verify dotnet
|
2021-02-04 15:49:04 +07:00
|
|
|
shell: pwsh
|
|
|
|
run: __tests__/verify-dotnet.ps1 3.1 2.2
|
2020-09-24 22:26:00 +07:00
|
|
|
|
2021-02-04 13:27:28 +07:00
|
|
|
test-setup-with-wildcard:
|
2021-02-04 13:19:10 +07:00
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-02-04 22:26:17 +07:00
|
|
|
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
2021-02-04 13:19:10 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Clear toolcache
|
2021-02-03 20:10:28 +07:00
|
|
|
shell: pwsh
|
2021-02-04 13:19:10 +07:00
|
|
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
2021-02-03 20:18:47 +07:00
|
|
|
- name: Setup dotnet 3.1.*
|
2020-09-24 22:26:00 +07:00
|
|
|
uses: ./
|
|
|
|
with:
|
2021-02-03 20:18:47 +07:00
|
|
|
dotnet-version: 3.1.*
|
2021-02-04 15:49:04 +07:00
|
|
|
- name: Setup dotnet 2.2.*
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
dotnet-version: 2.2.*
|
2021-02-03 20:10:28 +07:00
|
|
|
- name: Verify dotnet
|
2021-02-04 15:49:04 +07:00
|
|
|
shell: pwsh
|
|
|
|
run: __tests__/verify-dotnet.ps1 3.1 2.2
|
2021-02-03 20:18:47 +07:00
|
|
|
|
2020-01-26 13:37:54 +07:00
|
|
|
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
|
2020-09-15 23:36:09 +07:00
|
|
|
http_proxy: http://squid-proxy:3128
|
2020-01-26 13:37:54 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Clear tool cache
|
2020-09-15 23:36:09 +07:00
|
|
|
run: rm -rf "/usr/share/dotnet"
|
|
|
|
- name: Install curl
|
|
|
|
run: |
|
|
|
|
apt update
|
|
|
|
apt -y install curl
|
|
|
|
- name: Setup dotnet 3.1.201
|
2020-01-26 13:37:54 +07:00
|
|
|
uses: ./
|
|
|
|
with:
|
2020-09-15 23:36:09 +07:00
|
|
|
dotnet-version: 3.1.201
|
2020-09-03 01:11:56 +07:00
|
|
|
source-url: https://api.nuget.org/v3/index.json
|
|
|
|
env:
|
|
|
|
NUGET_AUTH_TOKEN: NOTATOKEN
|
2020-01-26 13:37:54 +07:00
|
|
|
- name: Verify dotnet
|
2021-02-04 17:48:03 +07:00
|
|
|
run: __tests__/verify-dotnet.sh 3.1.201
|
2019-07-12 03:22:28 +07:00
|
|
|
|
2020-01-26 13:37:54 +07:00
|
|
|
test-bypass-proxy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
https_proxy: http://no-such-proxy:3128
|
2020-09-15 23:36:09 +07:00
|
|
|
no_proxy: github.com,dotnetcli.blob.core.windows.net,download.visualstudio.microsoft.com,api.nuget.org,dotnetcli.azureedge.net
|
2020-01-26 13:37:54 +07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Clear tool cache
|
2020-09-15 23:36:09 +07:00
|
|
|
run: rm -rf "/usr/share/dotnet"
|
|
|
|
- name: Setup dotnet 3.1.201
|
2020-01-26 13:37:54 +07:00
|
|
|
uses: ./
|
|
|
|
with:
|
2020-09-15 23:36:09 +07:00
|
|
|
dotnet-version: 3.1.201
|
2020-09-03 01:11:56 +07:00
|
|
|
source-url: https://api.nuget.org/v3/index.json
|
|
|
|
env:
|
|
|
|
NUGET_AUTH_TOKEN: NOTATOKEN
|
2020-01-26 13:37:54 +07:00
|
|
|
- name: Verify dotnet
|
2021-02-04 17:48:03 +07:00
|
|
|
run: __tests__/verify-dotnet.sh 3.1.201
|