-
Notifications
You must be signed in to change notification settings - Fork 11
71 lines (68 loc) · 2.16 KB
/
build_test.yml
File metadata and controls
71 lines (68 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build And Test
on:
workflow_call:
inputs:
environment:
description: Environment to run tests against
type: string
default: CI
test_args:
description: Additional arguments to dotnet test
type: string
build_configuration:
description: Whether to build debug or release configuration of the code
type: string
default: debug
store_artifacts:
description: Determines whether or not to upload artifacts
type: boolean
default: false
secrets:
MC_CLIENT_ID:
MC_CLIENT_SECRET:
MC_CLIENT_MID:
MC_CLIENT_BASE_URI:
jobs:
build_test_archive:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup NPM
uses: actions/setup-node@v3
with:
node-version: '18'
cache-dependency-path: './src/vscode/package-lock.json'
cache: 'npm'
- name: Restore NPM
run: npm install -g typescript vsce ovsx
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: dotnet build --configuration ${{ inputs.build_configuration }} --no-restore
- name: Package VSCode Plugin
working-directory: ./src/vscode
run: vsce package
- name: Upload Sage VSCode Plugin
if: ${{ inputs.store_artifacts }}
uses: actions/upload-artifact@v3
with:
name: VSCode-Plugin
path: ./src/vscode/*.vsix
retention-days: 3
- name: Test
working-directory: ./src
env:
MC_CLIENT_ID: ${{ secrets.MC_CLIENT_ID }}
MC_CLIENT_SECRET: ${{ secrets.MC_CLIENT_SECRET }}
MC_CLIENT_MID: ${{ secrets.MC_CLIENT_MID }}
MC_CLIENT_BASE_URI: ${{ secrets.MC_CLIENT_BASE_URI }}
run: dotnet test --no-build --verbosity normal ${{ inputs.test_args }}