-
Notifications
You must be signed in to change notification settings - Fork 2
105 lines (84 loc) · 2.61 KB
/
CI.yaml
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
on:
push:
branches: [ master ]
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ master ]
jobs:
XUnit:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build Lib
run: dotnet build include/c#/10 --configuration Release
- name: Build Tests
run: dotnet build tests/c#/10 --configuration Release
- name: Test
run: dotnet test tests/c#/10 --configuration Release --no-build
PHPUnit:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
php_version: ['8.0', '8.1'] # strings so the .0 is preserved
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP(-Unit)
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: none, mbstring, openssl, tokenizer, ctype
tools: none, phpunit:9.5.26
- name: Test
run: phpunit --colors=auto --test-suffix Tests.php --bootstrap include/php/8.0/autoload.php ./tests/php/8.0
Jest:
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: tests/ts/es6
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Jest
run: npm ci
- name: Test
run: npm test
build-and-publish-nuget:
needs: [ XUnit, PHPUnit, Jest ]
runs-on: ubuntu-latest
timeout-minutes: 15
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Extract release notes
run: |
git log --pretty=format:'%d %s' $REF | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview\d{3})?)(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Validate version
run: grep -i "<Version>${VERSION}" include/c#/10/HsBuildCodes.csproj
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build include/c#/10 --configuration Release
- name: Pack
run: dotnet pack include/c#/10 --configuration Release --no-build --output .
- name: Push
run: dotnet nuget push "*.${VERSION}.nupkg" -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}