-
-
Notifications
You must be signed in to change notification settings - Fork 26
120 lines (108 loc) · 3.83 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
name: 'build-test'
on:
push:
pull_request:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
build_and_unit_test:
name: '${{ matrix.os }}: build and unit tests'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: lukka/get-cmake@latest
- uses: actions/setup-node@v4
with:
node-version: '20.x'
# How to consume GitHub packages, from this message (!): https://gh.neting.ccmunity/t/download-from-github-package-registry-without-authentication/14407/35
# Inspired from here: https://github.com/jcansdale-test/npmrc-configurations/blob/master/.github/workflows/blank.yml
- name: Authenticate to GitHub Packages
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
echo "@${{ github.repository_owner }}:registry=https://npm.pkg.github.com/" >> ~/.npmrc
- run: npm install
- run: npm run build
- run: npm run lint
- run: npm run test
- run: npm run pack
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: ${{ matrix.os }}-build_and_unit_test
base-path: ${{ runner.os != 'macOS' && '__tests__/theAssets/vcpkg_project/' || '' }}
debug: true
tests:
name: '${{ matrix.os }}: functional tests'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: checkout this action
uses: actions/checkout@v4
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: basic test for run-vcpkg (not running vcpkg).
uses: ./
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgGitCommitId: '8eb57355a4ffb410a2e94c07b4dca2dffbee8e50'
vcpkgGitUrl: 'https://github.com/microsoft/vcpkg.git'
- name: basic test for run-vcpkg with running 'vcpkg install'.
uses: ./
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgGitCommitId: '8eb57355a4ffb410a2e94c07b4dca2dffbee8e50'
runVcpkgInstall: true
vcpkgGitUrl: 'https://github.com/microsoft/vcpkg.git'
env:
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
- name: basic test for run-vcpkg with 'vcpkg-configuration.json'.
uses: ./
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
#vcpkgGitCommitId: is not provided intentionally, the Git commit it is read from vcpkg-configuration.json.
vcpkgConfigurationJsonGlob: '**/__tests__/theAssets/vcpkg_project/vcpkg-configuration.json'
tests_with_cache_hit:
needs: tests
name: '${{ matrix.os }}: functional tests'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: checkout this action
uses: actions/checkout@v4
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: basic test for run-vcpkg (not running vcpkg).
uses: ./
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgGitCommitId: '8eb57355a4ffb410a2e94c07b4dca2dffbee8e50'
vcpkgGitUrl: 'https://github.com/microsoft/vcpkg.git'
finalize_coveralls:
needs: build_and_unit_test
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Finalize Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
carryforward: "macos-latest-build_and_unit_test,ubuntu-latest-build_and_unit_test,windows-latest-build_and_unit_test"
debug: true