From 511be311df6deaae2ebd1a2aa194afe2dc1c86b6 Mon Sep 17 00:00:00 2001 From: dudu Date: Sun, 12 Feb 2023 07:38:56 +0800 Subject: [PATCH] ci: add github ci --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ build.sh | 12 ++---------- test.sh | 2 ++ 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci.yml mode change 100644 => 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 old mode 100644 new mode 100755 index 433a9b4..661769f --- a/build.sh +++ b/build.sh @@ -1,11 +1,3 @@ -#!/bin/bash -dotnet --info +#!/usr/bin/env bash dotnet restore - -for path in src/**/*.csproj; do - dotnet build -f netstandard2.0 -c Release ${path} -done - -for path in test/*.Tests/*.csproj; do - dotnet test -f netcoreapp2.0 -c Release ${path} -done +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