From cf764f13ab16f0c3db3ea413b0b91d2fb0624082 Mon Sep 17 00:00:00 2001 From: isaacabraham Date: Fri, 9 Sep 2022 21:34:29 +0100 Subject: [PATCH 1/6] Initial work --- .github/workflows/ci-build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/ci-build.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 000000000..f528c9264 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,24 @@ +name: Build, test and package +on: + pull_request: + push: + # branches: [ master ] + # paths: [ 'src/**', '*.md', '*.png', 'LICENSE', 'Farmer.sln' ] + +jobs: + CI: + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Restore .NET Tools + run: dotnet tool restore + - name: Fantomas Syntax Check + run: dotnet fantomas src -r --check + - name: Build Farmer + run: dotnet build -c release + - name: Run Tests + run: dotnet test -v n -c release -l trx --collect:"XPlat Code Coverage" \ No newline at end of file From 2aa5693a55740ba1cde1829f432b1a4b85849e2b Mon Sep 17 00:00:00 2001 From: isaacabraham Date: Fri, 9 Sep 2022 21:41:33 +0100 Subject: [PATCH 2/6] Activate branches and paths --- .github/workflows/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f528c9264..df6437722 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -2,8 +2,8 @@ name: Build, test and package on: pull_request: push: - # branches: [ master ] - # paths: [ 'src/**', '*.md', '*.png', 'LICENSE', 'Farmer.sln' ] + branches: [ master ] + paths: [ 'src/**', '*.md', '*.png', 'LICENSE', 'Farmer.sln' ] jobs: CI: From f90699641edd059bc5befd7e05a1aceb5224d106 Mon Sep 17 00:00:00 2001 From: isaacabraham Date: Fri, 9 Sep 2022 21:51:06 +0100 Subject: [PATCH 3/6] Support test results --- .github/workflows/ci-build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index df6437722..0b3b41114 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -21,4 +21,13 @@ jobs: - name: Build Farmer run: dotnet build -c release - name: Run Tests - run: dotnet test -v n -c release -l trx --collect:"XPlat Code Coverage" \ No newline at end of file + run: dotnet test -c release -l trx --collect:"XPlat Code Coverage" + - name: Upload Test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results-${{ matrix.dotnet-version }} + path: src/Tests/TestResults + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + - name: Create NuGet Package + run: dotnet pack .\src\Farmer\ --verbosity minimal --configuration Release From 48530787c0e745bb4720dda5ee8fd59f3be1b430 Mon Sep 17 00:00:00 2001 From: isaacabraham Date: Fri, 9 Sep 2022 21:55:02 +0100 Subject: [PATCH 4/6] Fix nuget pack --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 0b3b41114..56b02f4c8 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -30,4 +30,4 @@ jobs: # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} - name: Create NuGet Package - run: dotnet pack .\src\Farmer\ --verbosity minimal --configuration Release + run: dotnet pack ./src/Farmer --verbosity minimal --configuration Release From e81d4da513811ebdd801c4b92bad7178d32cc89f Mon Sep 17 00:00:00 2001 From: isaacabraham Date: Fri, 9 Sep 2022 22:03:21 +0100 Subject: [PATCH 5/6] NuGet package as artifact --- .github/workflows/ci-build.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 56b02f4c8..461234015 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -22,12 +22,10 @@ jobs: run: dotnet build -c release - name: Run Tests run: dotnet test -c release -l trx --collect:"XPlat Code Coverage" - - name: Upload Test results - uses: actions/upload-artifact@v3 - with: - name: dotnet-results-${{ matrix.dotnet-version }} - path: src/Tests/TestResults - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - name: Create NuGet Package run: dotnet pack ./src/Farmer --verbosity minimal --configuration Release + - name: Upload NuGet Package + uses: actions/upload-artifact@v3 + with: + name: farmer-package-${{ matrix.dotnet-version }} + path: src/Farmer/bin/Release/Farmer*nupkg From 5abbeacaa7b9aec5db5879ee65304b65d27be17b Mon Sep 17 00:00:00 2001 From: isaacabraham Date: Fri, 9 Sep 2022 22:08:01 +0100 Subject: [PATCH 6/6] Fix up name --- .github/workflows/ci-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 461234015..8cb52484f 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -4,7 +4,9 @@ on: push: branches: [ master ] paths: [ 'src/**', '*.md', '*.png', 'LICENSE', 'Farmer.sln' ] - +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true jobs: CI: strategy: @@ -27,5 +29,5 @@ jobs: - name: Upload NuGet Package uses: actions/upload-artifact@v3 with: - name: farmer-package-${{ matrix.dotnet-version }} + name: farmer-package path: src/Farmer/bin/Release/Farmer*nupkg