| 1 |
name: CI checks |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: |
| 6 |
paths-ignore: |
| 7 |
- CODE_OF_CONDUCT.md |
| 8 |
- CONTRIBUTING.md |
| 9 |
- COPYING |
| 10 |
- NEWS |
| 11 |
- README.md |
| 12 |
- SECURITY.md |
| 13 |
branches: |
| 14 |
- main |
| 15 |
|
| 16 |
jobs: |
| 17 |
meson: |
| 18 |
name: Build with Meson and gcc, and test |
| 19 |
runs-on: ubuntu-22.04 |
| 20 |
steps: |
| 21 |
- name: Install Dependencies |
| 22 |
run: | |
| 23 |
sudo apt-get update |
| 24 |
sudo apt-get install -y \ |
| 25 |
dbus \ |
| 26 |
docbook-xml \ |
| 27 |
docbook-xsl \ |
| 28 |
libglib2.0-dev \ |
| 29 |
meson \ |
| 30 |
xsltproc \ |
| 31 |
${NULL+} |
| 32 |
- name: Check out xdg-dbus-proxy |
| 33 |
uses: actions/checkout@v1 |
| 34 |
with: |
| 35 |
submodules: true |
| 36 |
- name: Create logs dir |
| 37 |
run: mkdir test-logs |
| 38 |
- name: configure |
| 39 |
run: | |
| 40 |
meson setup . _build |
| 41 |
- name: Build xdg-dbus-proxy |
| 42 |
run: ninja -C _build -v |
| 43 |
- name: Run tests |
| 44 |
run: meson test -C _build -v |
| 45 |
- name: Collect overall test logs on failure |
| 46 |
if: failure() |
| 47 |
run: mv _build/meson-logs/testlog.txt test-logs/ || true |
| 48 |
- name: Collect individual test logs on cancel |
| 49 |
if: failure() || cancelled() |
| 50 |
run: mv _build/meson-logs/testlog.txt test-logs/ || true |
| 51 |
- name: install |
| 52 |
run: | |
| 53 |
DESTDIR="$(pwd)/DESTDIR" meson install -C _build |
| 54 |
( cd DESTDIR && find -ls ) |
| 55 |
- name: distcheck |
| 56 |
run: | |
| 57 |
meson dist -C _build |
| 58 |
- name: Collect dist test logs on failure |
| 59 |
if: failure() |
| 60 |
run: mv _build/meson-private/dist-build/meson-logs/testlog.txt test-logs/disttestlog.txt || true |
| 61 |
- name: use as subproject |
| 62 |
run: | |
| 63 |
mkdir tests/use-as-subproject/subprojects |
| 64 |
tar -C tests/use-as-subproject/subprojects -xf _build/meson-dist/xdg-dbus-proxy-*.tar.xz |
| 65 |
mv tests/use-as-subproject/subprojects/xdg-dbus-proxy-* tests/use-as-subproject/subprojects/dbus-proxy |
| 66 |
( cd tests/use-as-subproject && meson setup . _build ) |
| 67 |
ninja -C tests/use-as-subproject/_build -v |
| 68 |
meson test -C tests/use-as-subproject/_build |
| 69 |
DESTDIR="$(pwd)/DESTDIR-as-subproject" meson install -C tests/use-as-subproject/_build |
| 70 |
( cd DESTDIR-as-subproject && find -ls ) |
| 71 |
test -x DESTDIR-as-subproject/usr/local/libexec/notflatpak-dbus-proxy |
| 72 |
- name: Upload test logs |
| 73 |
uses: actions/upload-artifact@v4 |
| 74 |
if: failure() || cancelled() |
| 75 |
with: |
| 76 |
name: test logs |
| 77 |
path: test-logs |
| 78 |
|
| 79 |
clang: |
| 80 |
name: Build with clang and analyze |
| 81 |
runs-on: ubuntu-22.04 |
| 82 |
strategy: |
| 83 |
fail-fast: false |
| 84 |
matrix: |
| 85 |
language: |
| 86 |
- cpp |
| 87 |
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] |
| 88 |
# Learn more: |
| 89 |
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed |
| 90 |
steps: |
| 91 |
# Initializes the CodeQL tools for scanning. |
| 92 |
- name: Initialize CodeQL |
| 93 |
uses: github/codeql-action/init@v3 |
| 94 |
with: |
| 95 |
languages: ${{ matrix.language }} |
| 96 |
# If you wish to specify custom queries, you can do so here or in a config file. |
| 97 |
# By default, queries listed here will override any specified in a config file. |
| 98 |
# Prefix the list here with "+" to use these queries and those in the config file. |
| 99 |
# queries: ./path/to/local/query, your-org/your-repo/queries@main |
| 100 |
- name: Install Dependencies |
| 101 |
run: | |
| 102 |
sudo apt-get update |
| 103 |
sudo apt-get install -y \ |
| 104 |
clang \ |
| 105 |
dbus \ |
| 106 |
docbook-xml \ |
| 107 |
docbook-xsl \ |
| 108 |
libglib2.0-dev \ |
| 109 |
libtool \ |
| 110 |
meson \ |
| 111 |
xsltproc \ |
| 112 |
${NULL+} |
| 113 |
- name: Check out xdg-dbus-proxy |
| 114 |
uses: actions/checkout@v1 |
| 115 |
with: |
| 116 |
submodules: true |
| 117 |
- name: Create logs dir |
| 118 |
run: mkdir test-logs |
| 119 |
- name: configure |
| 120 |
run: | |
| 121 |
meson setup . _build -Db_sanitize=address,undefined |
| 122 |
env: |
| 123 |
CC: clang |
| 124 |
- name: Build xdg-dbus-proxy |
| 125 |
run: ninja -C _build -v |
| 126 |
- name: Perform CodeQL Analysis |
| 127 |
uses: github/codeql-action/analyze@v3 |
| 128 |
- name: Run tests |
| 129 |
run: meson test -C _build -v |
| 130 |
- name: Collect overall test logs on failure |
| 131 |
if: failure() |
| 132 |
run: mv _build/meson-logs/testlog.txt test-logs/ || true |
| 133 |
- name: Collect individual test logs on cancel |
| 134 |
if: failure() || cancelled() |
| 135 |
run: mv _build/meson-logs/testlog.txt test-logs/ || true |
| 136 |
- name: Upload test logs |
| 137 |
uses: actions/upload-artifact@v4 |
| 138 |
if: failure() || cancelled() |
| 139 |
with: |
| 140 |
name: test logs |
| 141 |
path: test-logs |
| 142 |
|
| 143 |
valgrind: |
| 144 |
name: Run tests in valgrind |
| 145 |
needs: meson # Don't run expensive test if main check fails |
| 146 |
runs-on: ubuntu-22.04 |
| 147 |
steps: |
| 148 |
- name: Install Dependencies |
| 149 |
run: | |
| 150 |
sudo apt-get update |
| 151 |
sudo apt-get install -y \ |
| 152 |
clang \ |
| 153 |
dbus \ |
| 154 |
docbook-xml \ |
| 155 |
docbook-xsl \ |
| 156 |
libglib2.0-dev \ |
| 157 |
libtool \ |
| 158 |
meson \ |
| 159 |
valgrind \ |
| 160 |
xsltproc \ |
| 161 |
${NULL+} |
| 162 |
- name: Check out xdg-dbus-proxy |
| 163 |
uses: actions/checkout@v1 |
| 164 |
with: |
| 165 |
submodules: true |
| 166 |
- name: Create logs dir |
| 167 |
run: mkdir test-logs |
| 168 |
- name: configure |
| 169 |
run: | |
| 170 |
meson setup . _build |
| 171 |
env: |
| 172 |
CFLAGS: >- |
| 173 |
-O2 |
| 174 |
-Wp,-D_FORTIFY_SOURCE=2 |
| 175 |
- name: Build xdg-dbus-proxy |
| 176 |
run: ninja -C _build -v |
| 177 |
- name: Run tests |
| 178 |
run: meson test -C _build -v |
| 179 |
- name: Collect overall test logs on failure |
| 180 |
if: failure() |
| 181 |
run: mv _build/meson-logs/testlog.txt test-logs/ || true |
| 182 |
- name: Collect individual test logs on cancel |
| 183 |
if: failure() || cancelled() |
| 184 |
run: mv _build/meson-logs/testlog.txt test-logs/ || true |
| 185 |
- name: Upload test logs |
| 186 |
uses: actions/upload-artifact@v4 |
| 187 |
if: failure() || cancelled() |
| 188 |
with: |
| 189 |
name: test logs |
| 190 |
path: test-logs |