setup-dotnet/.github/workflows/workflow.yml

92 lines
2.4 KiB
YAML
Raw Normal View History

name: Main workflow
2020-01-26 14:37:54 +08:00
on:
pull_request:
push:
branches:
- master
- releases/*
jobs:
2020-01-26 14:37:54 +08:00
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
2019-12-19 00:26:43 +08:00
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
2019-07-26 10:59:29 +08:00
steps:
2019-07-24 01:22:11 +08:00
- name: Checkout
2020-01-26 14:37:54 +08:00
uses: actions/checkout@v2
- name: Set Node.js 12
uses: actions/setup-node@v1
with:
2020-01-26 14:37:54 +08:00
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
2020-01-26 14:37:54 +08:00
test:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clear tool cache
run: mv "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"
- name: Setup dotnet 3.0.100
uses: ./
with:
dotnet-version: 3.0.100
- name: Verify dotnet
if: runner.os != 'windows'
run: __tests__/verify-dotnet.sh 3.0.100
- name: Verify dotnet (Windows)
if: runner.os == 'windows'
run: __tests__/verify-dotnet.ps1 3.0.100
2020-01-26 14:37:54 +08: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
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clear tool cache
run: rm -rf $RUNNER_TOOL_CACHE/*
- name: Setup dotnet 3.0.100
uses: ./
with:
dotnet-version: 3.0.100
- name: Verify dotnet
run: __tests__/verify-dotnet.sh 3.0.100
2020-01-26 14:37:54 +08:00
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
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clear tool cache
run: mv "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"
- name: Setup dotnet 3.0.100
uses: ./
with:
dotnet-version: 3.0.100
- name: Verify dotnet
run: __tests__/verify-dotnet.sh 3.0.100