-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (129 loc) · 5.04 KB
/
build-test.yml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: build-test
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
#push:
# branches: [ main, dev, v* ]
# paths-ignore:
# - 'README.md'
#pull_request:
# branches: [ main, dev, v* ]
# paths-ignore:
# - 'README.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
reason:
description: 'The reason for running the workflow'
required: true
default: 'Manual run'
env:
DOTNET_VERSION: '6.0.x'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-test:
name: build-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# If triggered manually, print the reason why
- name: 'Print manual run reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "Reason: ${{ github.event.inputs.reason }}"
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
#- name: Test
# run: dotnet test --no-restore --verbosity normal
- name: Test
uses: zyborg/dotnet-tests-report@v1
with:
report_name: spm_tests
report_title: spm Tests
github_token: ${{ secrets.GITHUB_TOKEN }}
#analize:
# name: analize
# needs: build-test
# runs-on: windows-2019
# steps:
# - uses: actions/checkout@v2
# - name: Setup .NET
# uses: actions/setup-dotnet@v2
# with:
# dotnet-version: ${{ env.DOTNET_VERSION }}
# - name: Restore
# run: dotnet restore
# - name: Run .NET Code Analysis
# uses: dotnet/code-analysis@main
# id: code-analysis
# with:
# build-breaking: false
# all-categories: recommended
actions:
needs: build-test
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: eisbaer66/spm@main
- uses: eisbaer66/spm@main
with:
action: update
- id: spm
uses: eisbaer66/spm@main
with:
working-directory: ./SourcePawnManager.Core.Tests
verbosity: 4
github-token: ${{ secrets.GITHUB_TOKEN }}
- if: steps.spm.outputs.dependency-count != 0
run: |
echo "${{ steps.spm.outputs.message }}"
- if: steps.spm.outputs.exit-code != 0
run: |
echo "restore failed with exit-code ${{ steps.spm.outputs.exit-code }}: ${{ steps.spm.outputs.message }}"
#setup-actions-test:
# #needs: build-test
# # The type of runner that the job will run on
# runs-on: ubuntu-latest
# container: mcr.microsoft.com/dotnet/runtime:6.0
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v3
# #- run: |
# # apt-get update &&
# # apt-get -y install curl
# #- name: Setup .NET
# # uses: actions/setup-dotnet@v2
# # with:
# # dotnet-version: ${{ env.DOTNET_VERSION }}
# - run: |
# # Update the list of packages
# apt-get update
# # Install pre-requisite packages.
# apt-get install -y wget apt-transport-https software-properties-common
# # Download the Microsoft repository GPG keys
# wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
# # Register the Microsoft repository GPG keys
# dpkg -i packages-microsoft-prod.deb
# # Update the list of packages after we added packages.microsoft.com
# apt-get update
# # Install PowerShell
# apt-get install -y powershell
# - run: mkdir spm
# - shell: pwsh
# run: |
# [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
# &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing -Headers @{Authorization='token ${{ secrets.GITHUB_TOKEN }}'; Accept='application/vnd.github.v3+raw'} 'https://raw.githubusercontent.com/eisbaer66/spm/v0.2/install-spm-template.ps1')))
# working-directory: spm
# continue-on-error: true
# - run: pwsh -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing -Headers @{Authorization='token ${{ secrets.GITHUB_TOKEN }}'; Accept='application/vnd.github.v3+raw'} 'https://raw.githubusercontent.com/eisbaer66/spm/v0.2/install-spm-template.ps1')))"
# working-directory: spm
# - run: spm update
# - run: spm -vvvv -github-token ${{ secrets.GITHUB_TOKEN }} update
# working-directory: ./SourcePawnManager.Core.Tests
# - run: dotnet --version