From 459021ab54eacbf69a682eea2cbf9c848af2839d Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 2 Jun 2020 15:41:25 +0800 Subject: Add Github Actions. --- .github/workflows/ci.yaml | 76 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yaml (limited to '.github/workflows') diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..be473c20 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,76 @@ +name: Routine Build And Test + +on: + push: + branches: [dev] + paths-ignore: + - "**/README.md" + pull_request: + branches: [dev] + paths-ignore: + - "**/README.md" + +jobs: + front-end: + name: Front End Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: Timeline/ClientApp + shell: bash + + steps: + - uses: actions/checkout@v2 + + - name: Restore Cache + uses: actions/cache@v2 + with: + path: | + Timeline/ClientApp/.pnp.* + Timeline/ClientApp/.yarn + !Timeline/ClientApp/.yarn/releases + !Timeline/ClientApp/.yarn/plugins + key: yarn-${{ runner.os }}-${{ hashFiles('Timeline/ClientApp/yarn.lock') }} + restore-keys: | + yarn-${{ runner.os }}- + + - name: Use Node.js 14 + uses: actions/setup-node@v1 + with: + node-version: "14" + + - name: Restore Packages + run: yarn + + - name: Build App + run: yarn build + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: front-end + path: Timeline/ClientApp/dist/ + + back-end: + name: Back End Build And Test + runs-on: ubuntu-latest + env: + ASPNETCORE_ENVIRONMENT: "Development" + + steps: + - uses: actions/checkout@v2 + + - name: Use .Net Core 3.1.x + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "3.1.x" + + - name: Build And Test + run: dotnet test --logger html --collect:"XPlat Code Coverage" --settings './Timeline.Tests/coverletArgs.runsettings' + + - name: Upload Test Artifact + uses: actions/upload-artifact@v2 + if: ${{ success() || failure() }} + with: + name: back-end-test + path: Timeline.Tests/TestResults/ -- cgit v1.2.3