107 lines (98 loc) · 3.2 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
name: 'build-test'
on:
push:
pull_request:
schedule:
- cron: '0 1 * * SUN'
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@v2.4.0
with:
submodules: true
- uses: actions/setup-node@v2.5.1
with:
node-version: '12.x'
# How to consume GitHub packages, from this message (!): https://github.community/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
npm run test
name: build and test
shell: bash
- name: Coveralls
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: ${{ matrix.os }}-build_and_unit_test
env:
NODE_COVERALLS_DEBUG: 1
tests:
needs: build_and_unit_test
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@v2.4.0
with:
submodules: true
- name: basic test for run-vcpkg (not running vcpkg).
uses: ./
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgGitCommitId: 'd417ae59d6e9aa20d9f812b5deb966645c54687d'
- name: basic test for run-vcpkg with running 'vcpkg install'.
uses: ./
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgGitCommitId: 'd417ae59d6e9aa20d9f812b5deb966645c54687d'
runVcpkgInstall: true
# This forces the creation of a new cache entry each time the workflow is run.
# It is the same across jobs in the same workflows.
appendedCacheKey: ${{ env.GITHUB_RUN_ID }}
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@v2.4.0
with:
submodules: true
- name: basic test for run-vcpkg (not running vcpkg).
uses: ./
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgGitCommitId: 'd417ae59d6e9aa20d9f812b5deb966645c54687d'
appendedCacheKey: ${{ env.GITHUB_RUN_ID }}
finalize_coveralls:
needs: build_and_unit_test
runs-on: ubuntu-latest
steps:
- name: Finalize Coveralls
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
env:
NODE_COVERALLS_DEBUG: 1