forked from eclipse-cdt-cloud/cdt-gdb-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (121 loc) · 3.98 KB
/
build-push.yml
File metadata and controls
121 lines (121 loc) · 3.98 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
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
# This workflow runs on pushes - it is similar to what happens in PR
# workflow, but doesn't need to be split across multiple workflows
# as this one runs where there is sufficient permission to report
# results back
name: build-push
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
Build-on-Ubuntu:
name: Build & Test on Ubuntu
runs-on: ubuntu-latest
permissions:
packages: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install GCC & GDB & other build essentials
run: |
sudo apt-get update
sudo apt-get -y install build-essential gcc g++ gdb gdbserver socat
gdb --version
gcc --version
gdbserver --version
- name: Enable ptrace so tests can attach to running processes, see attach.spec.ts
run: |
sudo sysctl kernel.yama.ptrace_scope=0
- name: Build
run: yarn
- name: Build Test Programs
run: make -C src/integration-tests/test-programs
- name: Test
run: yarn test-ci
- name: Log file artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-logs-ubuntu
path: test-logs/
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: 'test-reports/*.xml'
fail_on_failure: true
require_tests: true
check_name: Test Results on Ubuntu
- name: Verify no unexpected changes to source tree
run: git diff --exit-code
Build-on-Windows:
name: Build & Test on Windows
runs-on: windows-latest
permissions:
packages: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
# Install build tools and update PATH through GITHUB_PATH for next steps
- name: Install GCC & GDB & other build essentials
run: |
choco install mingw --version=11.2.0.07112021
$chocoMingwBin = Join-Path $env:ChocolateyInstall 'lib\mingw\tools\install\mingw64\bin'
echo $chocoMingwBin >> $env:GITHUB_PATH
- name: Echo Tool Versions
run: |
gdb --version
gcc --version
gdbserver --version
make --version
- name: Build
run: yarn
- name: Build Test Programs
run: make -C src/integration-tests/test-programs
- name: Use special Mocha settings on Windows tests
run: |
Copy -path .mocharc-windows-ci.json -destination .mocharc.json -verbose
- name: Test
run: yarn test-ci
- name: Log file artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-logs-windows
path: test-logs/
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: 'test-reports/*.xml'
fail_on_failure: true
require_tests: true
check_name: Test Results on Windows
# Publish to NPM if tag is pushed and build and test succeeds
# on both Linux and Windows. Note this is not restricted to 'main'.
Publish-to-NPM:
name: Publish Package to NPM
runs-on: ubuntu-latest
needs: [Build-on-Ubuntu, Build-on-Windows]
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Update npm (OIDC/provenance support)
run: npm i -g npm@latest
- name: Build
run: yarn
- name: Publish (OIDC)
run: npm publish