From 8f967b3f716d72cbc45f156aaa1b9557b57c5f10 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 23 Mar 2024 17:46:29 -0400 Subject: [PATCH 1/7] WIP on GitHub Action YAML --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7e0b062 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: +jobs: + build_and_test: + name: Build / Test + + runs-on: ubuntu-latest + + strategy: + matrix: + dotnet-version: [ "6.0", "7.0", "8.0" ] + + services: + postgres: + image: postgres:latest + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + rethink: + image: rethinkdb:latest + ports: + - 28015:28015 + - 29015:29015 + + steps: + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v4.0.0 + with: + dotnet-version: 8.x + - name: Restore dependencies + run: dotnet restore src/MyWebLog.sln + - name: Build (${{ matrix.dotnet-version }}) + run: dotnet build src/MyWebLog.sln --no-restore -f net${{ matrix.dotnet-version }} + - name: Test (${{ matrix.dotnet-version }}) + run: dotnet run --project src/MyWebLog.Tests/MyWebLog.Tests.fsproj -f net${{ matrix.dotnet-version }} + -- 2.45.1 From b23f42e0c4e238c25452bd3450ec1284a788f846 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 23 Mar 2024 18:21:00 -0400 Subject: [PATCH 2/7] Update name --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e0b062..daa983e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,9 @@ +name: Continuous Integration on: push: - branches: - - main + branches: [ "main" ] pull_request: - branches: - - main + branches: [ "main" ] workflow_dispatch: jobs: build_and_test: -- 2.45.1 From f7cd9a358043ae779616dcb8e4b7346345e963d5 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 23 Mar 2024 18:25:08 -0400 Subject: [PATCH 3/7] Add pwd and ls to determine why restore is failing --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daa983e..a87cd0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,10 @@ jobs: uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.x + - name: Show current location + run: pwd + - name: Show files at current location + run: ls -l - name: Restore dependencies run: dotnet restore src/MyWebLog.sln - name: Build (${{ matrix.dotnet-version }}) -- 2.45.1 From afadaaf087ca9e29ee33ae59cac6f101f9e018b4 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 23 Mar 2024 18:29:24 -0400 Subject: [PATCH 4/7] Add check out step --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a87cd0f..e99213c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,14 +34,16 @@ jobs: - 29015:29015 steps: + - name: Check Out Code + uses: actions/cehckout@v4 - name: Setup .NET Core SDK uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.x - - name: Show current location - run: pwd - - name: Show files at current location - run: ls -l +# - name: Show current location +# run: pwd +# - name: Show files at current location +# run: ls -l - name: Restore dependencies run: dotnet restore src/MyWebLog.sln - name: Build (${{ matrix.dotnet-version }}) -- 2.45.1 From 04eea94e6290fd82755d3b6d8bcaefdce4a987a6 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 23 Mar 2024 18:30:22 -0400 Subject: [PATCH 5/7] typing... how does it work? --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e99213c..0b46561 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Check Out Code - uses: actions/cehckout@v4 + uses: actions/checkout@v4 - name: Setup .NET Core SDK uses: actions/setup-dotnet@v4.0.0 with: -- 2.45.1 From 3163c087f061b6edfbca5af078295c4c1d4e1e01 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 23 Mar 2024 18:37:08 -0400 Subject: [PATCH 6/7] Remove no-restore from build --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b46561..4f9492e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,14 +40,10 @@ jobs: uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.x -# - name: Show current location -# run: pwd -# - name: Show files at current location -# run: ls -l - name: Restore dependencies run: dotnet restore src/MyWebLog.sln - name: Build (${{ matrix.dotnet-version }}) - run: dotnet build src/MyWebLog.sln --no-restore -f net${{ matrix.dotnet-version }} + run: dotnet build src/MyWebLog.sln -f net${{ matrix.dotnet-version }} - name: Test (${{ matrix.dotnet-version }}) run: dotnet run --project src/MyWebLog.Tests/MyWebLog.Tests.fsproj -f net${{ matrix.dotnet-version }} -- 2.45.1 From 3d578118b3a3922d9dc9400a23838e9d9dd54dd5 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 23 Mar 2024 18:41:45 -0400 Subject: [PATCH 7/7] Only use net6.0 --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f9492e..e348191 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,10 @@ jobs: strategy: matrix: - dotnet-version: [ "6.0", "7.0", "8.0" ] + dotnet-version: + - "6.0" +# - "7.0" +# - "8.0" services: postgres: -- 2.45.1