E2E test with minikube on gh action (#513)
* add minikube as e2e test server * fix format * update env * force no skip * fix then * finish skip test * add skip blocker * fix path * output skipped case * enable test env var * final merge * add missing file
This commit is contained in:
65
.github/workflows/buildtest.yaml
vendored
Normal file
65
.github/workflows/buildtest.yaml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Build and Test
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
name: Dotnet build
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup dotnet SDK 2.1
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '2.1.x'
|
||||
- name: Setup dotnet SDK 3.1
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '3.1.x'
|
||||
- name: Setup Format
|
||||
run: dotnet tool install -g dotnet-format
|
||||
- name: Check Format
|
||||
# don't check formatting on Windows b/c of CRLF issues.
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: dotnet format --check --dry-run --exclude ./src/KubernetesClient/generated/
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release
|
||||
- name: Test
|
||||
run: dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura"
|
||||
# - uses: 5monkeys/cobertura-action@master
|
||||
# with:
|
||||
# path: tests/KubernetesClient.Tests/coverage.netcoreapp2.1.cobertura.xml
|
||||
# repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# minimum_coverage: 0
|
||||
e2e:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup dotnet SDK 2.1
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '2.1.x'
|
||||
- name: Setup dotnet SDK 3.1
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '3.1.x'
|
||||
- name: Minikube
|
||||
run: minikube start
|
||||
- name: Test
|
||||
run: |
|
||||
true > skip.log
|
||||
env K8S_E2E_MINIKUBE=1 dotnet test tests/E2E.Tests --logger "SkipTestLogger;file=$PWD/skip.log"
|
||||
if [ -s skip.log ]; then
|
||||
cat skip.log
|
||||
echo "CASES MUST NOT BE SKIPPED"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [assigned, opened, synchronize, reopened]
|
||||
Reference in New Issue
Block a user