-
Notifications
You must be signed in to change notification settings - Fork 6
90 lines (73 loc) · 2.54 KB
/
test.yml
File metadata and controls
90 lines (73 loc) · 2.54 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
name: libession-util-nodejs build test
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022, macos-15-intel, macos-14, ubuntu-24.04]
env:
SIGNAL_ENV: production
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: git config --global core.autocrlf false
- name: Checkout git repo
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Setup ccache
uses: hendrikmuhs/ccache-action@5ebbd400eff9e74630f759d94ddd7b6c26299639 # v1.2
with:
key: ${{ matrix.os }}-ccache-libsession-util-nodejs-${{ github.head_ref || github.ref_name }}
# if the exact key is not found, fallback to one matching our cache_suffix
restore-keys: ${{ matrix.os }}-ccache-libsession-util-nodejs-
- name: Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- name: Setup pnpm hoisted node-linker (Windows Only)
if: runner.os == 'Windows'
shell: bash
run: pnpm config set node-linker hoisted
- name: Setup node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
cache-dependency-path: "pnpm-lock.yaml"
- name: Install correct clang versions
if: runner.os == 'Linux'
run: sudo apt update && sudo apt search clang && sudo apt install clang-format-19
shell: bash
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'
- name: build libsession-util-nodejs
shell: bash
run: pnpm install --frozen-lockfile
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Check formatting
if: runner.os == 'Linux'
run: clang-format-19 --dry-run --Werror src/*.cpp include/*.hpp src/**/*.cpp include/**/*.hpp
shell: bash
- name: Ensure pnpm-lock.yaml has no duplicates
run: pnpm dedupe --check
- name: Validate formatting & linting changed no files
run: git diff --exit-code