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 +++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 4 ++- .vscode/launch.json | 41 ------------------------- .vscode/tasks.json | 36 ---------------------- azure-pipelines.yml | 6 +--- nuget.config | 7 ----- 6 files changed, 80 insertions(+), 90 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/tasks.json delete mode 100644 nuget.config 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/ diff --git a/.gitignore b/.gitignore index 10d8a462..d347c514 100644 --- a/.gitignore +++ b/.gitignore @@ -232,4 +232,6 @@ _Pvt_Extensions # My draft files. -*.draft +*.draft + +.vscode diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 74744083..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": "Python: Current File", - "type": "python", - "request": "launch", - "program": "${file}", - "console": "integratedTerminal" - }, - { - "name": ".NET Core Launch (web)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/Timeline/bin/Debug/netcoreapp2.2/Timeline.dll", - "args": [], - "cwd": "${workspaceFolder}/Timeline", - "stopAtEntry": false, - "launchBrowser": { - "enabled": true - }, - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/Views" - } - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index eeb06c4f..00000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/Timeline/Timeline.csproj" - ], - "problemMatcher": "$tsc" - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/Timeline/Timeline.csproj" - ], - "problemMatcher": "$tsc" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "${workspaceFolder}/Timeline/Timeline.csproj" - ], - "problemMatcher": "$tsc" - } - ] -} \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7246c8dc..c0aaee67 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,11 +37,7 @@ stages: packageType: sdk version: 3.1.x - - script: | - dotnet restore Timeline/Timeline.csproj --configfile nuget.config - dotnet restore Timeline.Tests/Timeline.Tests.csproj --configfile nuget.config - displayName: Dotnet Restore - - script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx --collect:"XPlat Code Coverage" --settings './Timeline.Tests/coverletArgs.runsettings' + - script: dotnet test --configuration $(buildConfiguration) --logger trx --collect:"XPlat Code Coverage" --settings './Timeline.Tests/coverletArgs.runsettings' displayName: Dotnet Test - task: PublishTestResults@2 diff --git a/nuget.config b/nuget.config deleted file mode 100644 index 9b715cbd..00000000 --- a/nuget.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - -- cgit v1.2.3