From e385e814c9ab6c4add5c42d3dc4c5be4ef90c349 Mon Sep 17 00:00:00 2001 From: dudu Date: Sun, 5 Feb 2023 15:03:18 +0800 Subject: [PATCH] ci: add test job --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ build.sh | 3 +++ test.sh | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100755 build.sh create mode 100755 test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dda509f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test: + runs-on: ubuntu-latest + container: mcr.microsoft.com/dotnet/sdk:7.0 + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build + run: ./build.sh + - name: Test + run: ./test.sh + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..661769f --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +dotnet restore +dotnet build -c Release \ No newline at end of file diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..d1b407f --- /dev/null +++ b/test.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +dotnet test -c Release \ No newline at end of file