From f9490673e1ee624b9f9087acfaae3ca871b0c2ac Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 12:05:06 +0530 Subject: [PATCH 01/10] adds a simple test pipeline job --- .github/workflows/build-test-lint.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/build-test-lint.yml diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml new file mode 100644 index 00000000..8ba66a8a --- /dev/null +++ b/.github/workflows/build-test-lint.yml @@ -0,0 +1,24 @@ +name: Dotnet Build, Test and Deploy + +on: + push + +jobs: + build-test-lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout Xero-NetStandard repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/Xero-NetStandard + path: Xero-NetStandard + + - name: Set up .NET environment + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8' + + - name: Build post generation + run: dotnet build + working-directory: Xero-NetStandard \ No newline at end of file From 8c98d11084f627c0560c312f86d6f7166674be46 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 12:11:32 +0530 Subject: [PATCH 02/10] adds workflow dispatch --- .github/workflows/build-test-lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 8ba66a8a..ef049c8c 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -1,7 +1,9 @@ name: Dotnet Build, Test and Deploy on: - push + push: + repository_dispatch: + types: [trigger-from-public-repo] jobs: build-test-lint: From 0712fd8a3eaf3346d44754894ae29cd71bcec576 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 14:00:58 +0530 Subject: [PATCH 03/10] run job only when PR is raised --- .../{build-test-lint.yml => build-test.yml} | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) rename .github/workflows/{build-test-lint.yml => build-test.yml} (76%) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test.yml similarity index 76% rename from .github/workflows/build-test-lint.yml rename to .github/workflows/build-test.yml index ef049c8c..6fcd7fd6 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test.yml @@ -1,9 +1,12 @@ -name: Dotnet Build, Test and Deploy +name: Dotnet Build, Test on: + pull_request: + paths: + - '**' push: - repository_dispatch: - types: [trigger-from-public-repo] + branches: + - master jobs: build-test-lint: @@ -23,4 +26,6 @@ jobs: - name: Build post generation run: dotnet build - working-directory: Xero-NetStandard \ No newline at end of file + + - name: Run Test + run: dotnet test \ No newline at end of file From 4842fee7c60a95212c6b9d83b8e12b945982f14e Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 14:02:18 +0530 Subject: [PATCH 04/10] check if build is triggered when push is made to the existing PR --- .github/workflows/build-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 6fcd7fd6..79104fa5 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -28,4 +28,5 @@ jobs: run: dotnet build - name: Run Test - run: dotnet test \ No newline at end of file + run: dotnet test + \ No newline at end of file From 10f44c629d33e6ca3044f969f79502af9a4e209d Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 14:03:24 +0530 Subject: [PATCH 05/10] removed push targetting branch --- .github/workflows/build-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 79104fa5..85129253 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -5,8 +5,6 @@ on: paths: - '**' push: - branches: - - master jobs: build-test-lint: @@ -29,4 +27,3 @@ jobs: - name: Run Test run: dotnet test - \ No newline at end of file From 02733a66d906aa40c70963a5cfeb23c1dc31f10c Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 14:05:00 +0530 Subject: [PATCH 06/10] adds working directory --- .github/workflows/build-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 85129253..894e2561 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -24,6 +24,8 @@ jobs: - name: Build post generation run: dotnet build + working-directory: Xero-NetStandard + - name: Run Test run: dotnet test From 457e4911e05f4b889ff231fa2977cb2f749de8ab Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 14:06:58 +0530 Subject: [PATCH 07/10] add working directory for test project --- .github/workflows/build-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 894e2561..9ae46b92 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -29,3 +29,4 @@ jobs: - name: Run Test run: dotnet test + working-directory: Xero-NetStandard From 47a5006190ec5933b50d53d4222ef58fd76abd12 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 15:07:40 +0530 Subject: [PATCH 08/10] run pipeline only on every push --- .github/workflows/build-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 9ae46b92..62e5a9a8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,9 +1,6 @@ name: Dotnet Build, Test on: - pull_request: - paths: - - '**' push: jobs: From e3b8ba828b6ac2173fbf413e0873b553154c65ae Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 15:17:30 +0530 Subject: [PATCH 09/10] add linting step --- .github/workflows/build-test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 62e5a9a8..32ae0ab5 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -17,12 +17,16 @@ jobs: - name: Set up .NET environment uses: actions/setup-dotnet@v4 with: - dotnet-version: '8' + dotnet-version: '3.1' - name: Build post generation run: dotnet build working-directory: Xero-NetStandard + - name: Validate Lint + run: dotnet format --verify-no-changes + working-directory: Xero-NetStandard + - name: Run Test run: dotnet test From 74b90b2f6161cdf7e41b525d81ac4ce63f202e41 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 15:24:42 +0530 Subject: [PATCH 10/10] commented lint --- .github/workflows/build-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 32ae0ab5..eb05076d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -23,9 +23,9 @@ jobs: run: dotnet build working-directory: Xero-NetStandard - - name: Validate Lint - run: dotnet format --verify-no-changes - working-directory: Xero-NetStandard + # - name: Validate Lint + # run: dotnet format --verify-no-changes + # working-directory: Xero-NetStandard - name: Run Test