Skip to content

Commit faf69f9

Browse files
committed
10. attempt github package push
1 parent 0eed34c commit faf69f9

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/CI-PR.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI-PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- dev
7+
paths-ignore:
8+
- 'docs/**'
9+
10+
env:
11+
VERSION: ''
12+
BRANCH: ''
13+
14+
jobs:
15+
build:
16+
name: Build and verify library
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
22+
- uses: dotnet/nbgv@master
23+
with:
24+
setAllVars: true
25+
- name: Setting VERSION and BRANCH env
26+
run: |
27+
echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
28+
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
29+
- name: Update tokens in project files
30+
uses: cschleiden/replace-tokens@v1
31+
with:
32+
files: '["*.csproj", "**/*.csproj"]'
33+
- uses: actions/setup-dotnet@v1
34+
with:
35+
dotnet-version: '3.1.202'
36+
- name: Building library
37+
run: |
38+
dotnet restore src
39+
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
40+
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
41+
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
42+
dotnet build src/bunit.testassets/ -c Release --no-restore
43+
- name: Running unit tests
44+
run: |
45+
dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
46+
dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
47+
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
48+
- name: Creating library package
49+
run: |
50+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
51+
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
52+
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
53+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
54+
- name: Buidling template package
55+
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
56+
- name: Verifying template
57+
run: |
58+
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
59+
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
60+
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
61+
dotnet test ${GITHUB_WORKSPACE}/Test

0 commit comments

Comments
 (0)