Skip to content

Commit

Permalink
use meson setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lidaobing committed Dec 13, 2023
1 parent 3e9a97e commit 5a51eca
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 73 deletions.
128 changes: 64 additions & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ '**' ]
branches: ["**"]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build-on-mac:
Expand All @@ -13,27 +13,27 @@ jobs:
runs-on: [macos-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2
- name: Configure Homebrew cache
uses: actions/cache@v2
with:
path: |
~/Library/Caches/Homebrew
key: ${{ runner.os }}-v1
- name: brew install
run: brew install --display-times meson gettext gtk+3 jsoncpp glog gtk-mac-integration libsigc++@2
- name: meson
run: meson builddir
- name: build
run: ninja -v -C builddir
- name: install
run: ninja -C builddir install
- name: test
run: |
sudo ifconfig lo0 alias 127.0.0.2 up
sudo ifconfig lo0 alias 127.0.0.3 up
sudo ifconfig lo0 alias 127.0.0.4 up
meson test -C builddir --verbose --no-stdsplit
- uses: actions/checkout@v2
- name: Configure Homebrew cache
uses: actions/cache@v2
with:
path: |
~/Library/Caches/Homebrew
key: ${{ runner.os }}-v1
- name: brew install
run: brew install --display-times meson gettext gtk+3 jsoncpp glog gtk-mac-integration libsigc++@2
- name: meson
run: meson setup build
- name: build
run: meson compile -C build
- name: install
run: meson install -C build
- name: test
run: |
sudo ifconfig lo0 alias 127.0.0.2 up
sudo ifconfig lo0 alias 127.0.0.3 up
sudo ifconfig lo0 alias 127.0.0.4 up
meson test -C build --verbose --no-stdsplit
build-on-linux:
strategy:
Expand All @@ -42,47 +42,47 @@ jobs:
compiler: [g++, clang++]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2
- name: apt install
run: sudo apt update && sudo apt install -y libgoogle-glog-dev libgtk-3-dev libglib2.0-dev libjsoncpp-dev g++ meson xvfb libsigc++-2.0-dev appstream
- name: meson
run: meson builddir
env:
CXX: ${{ matrix.compiler }}
- name: build
run: ninja -v -C builddir
- name: install
run: sudo ninja -C builddir install
- name: test
run: |
xvfb-run -a meson test -C builddir --verbose --no-stdsplit
- uses: actions/checkout@v2
- name: apt install
run: sudo apt update && sudo apt install -y libgoogle-glog-dev libgtk-3-dev libglib2.0-dev libjsoncpp-dev g++ meson xvfb libsigc++-2.0-dev appstream
- name: meson
run: meson setup build
env:
CXX: ${{ matrix.compiler }}
- name: build
run: meson compile -C build
- name: install
run: sudo meson install -C build
- name: test
run: |
xvfb-run -a meson test -C build --verbose --no-stdsplit
codecov:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: apt install
run: sudo apt update && sudo apt install -y lcov libgoogle-glog-dev libgtk-3-dev libglib2.0-dev libjsoncpp-dev g++ meson xvfb libsigc++-2.0-dev appstream
- name: meson
run: meson -D b_coverage=true builddir
- name: build
run: ninja -v -C builddir
- name: install
run: sudo ninja -C builddir install
- name: test
run: |
xvfb-run -a meson test -C builddir --verbose --no-stdsplit
- name: lcov
run: |
lcov --directory . --capture --output-file coverage.info; # capture coverage info
lcov --remove coverage.info '/usr/*' --output-file coverage.info; # filter out system
lcov --remove coverage.info '*Test*' --output-file coverage.info; # filter out system
lcov --remove coverage.info '*gtest*' --output-file coverage.info; # filter out system
lcov --list coverage.info; #debug info
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- uses: actions/checkout@v2
- name: apt install
run: sudo apt update && sudo apt install -y lcov libgoogle-glog-dev libgtk-3-dev libglib2.0-dev libjsoncpp-dev g++ meson xvfb libsigc++-2.0-dev appstream
- name: meson
run: meson setup -D b_coverage=true build
- name: build
run: meson compile -C build
- name: install
run: sudo meson install -C build
- name: test
run: |
xvfb-run -a meson test -C build --verbose --no-stdsplit
- name: lcov
run: |
lcov --directory . --capture --output-file coverage.info; # capture coverage info
lcov --remove coverage.info '/usr/*' --output-file coverage.info; # filter out system
lcov --remove coverage.info '*Test*' --output-file coverage.info; # filter out system
lcov --remove coverage.info '*gtest*' --output-file coverage.info; # filter out system
lcov --list coverage.info; #debug info
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

build_job:
# The host should always be linux
Expand Down Expand Up @@ -153,10 +153,10 @@ jobs:
# Produce a binary artifact and place it in the mounted volume
run: |
meson builddir
ninja -v -C builddir
ninja -C builddir install
xvfb-run -a meson test -C builddir --verbose --no-stdsplit
meson setup build
meson compile -C build
meson install -C build
xvfb-run -a meson test -C build --verbose --no-stdsplit
# - name: Show the artifact
# # Items placed in /artifacts in the container will be in
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ brew install iptux
sudo apt-get install git libgoogle-glog-dev libgtk-3-dev libglib2.0-dev libjsoncpp-dev g++ meson libsigc++-2.0-dev
git clone git://github.com/iptux-src/iptux.git
cd iptux
meson builddir && ninja -C builddir
sudo ninja -C builddir install
meson setup build && meson compile -C build
sudo meson install -C build
iptux
```

Expand All @@ -63,8 +63,8 @@ iptux
brew install meson gettext gtk+3 jsoncpp glog gtk-mac-integration libsigc++@2
git clone git://github.com/iptux-src/iptux.git
cd iptux
meson builddir
ninja -C builddir install
meson setup build
meson install -C build
iptux
```

Expand All @@ -79,7 +79,7 @@ check https://github.com/iptux-src/iptux/wiki/Compatible-List

## Develop

* use `meson -Ddev=true builddir` to build an iptux which can use resource in source directory.
* use `meson setup -Ddev=true build` to build an iptux which can use resource in source directory.
* start 2 iptux on one machine for test
* It's a known bug that you can not send file between 127.0.0.2 and 127.0.0.3
```sh
Expand All @@ -97,11 +97,11 @@ iptux -b 127.0.0.3 &
### How to update `po/iptux.pot`

```
meson builddir
meson setup build
git ls-files *.cpp *.desktop.in *.ui *.metainfo.xml | grep -v Test | LC_ALL=C sort > po/POTFILES
ninja -C builddir iptux-pot
ninja -C builddir iptux-update-po
for f in po/*.po; do echo -n "$f: "; msgfmt -v $f; done
ninja -C build iptux-pot
ninja -C build iptux-update-po
for f in po/*.po; do echo -n "$f: "; msgfmt -v $f; done
```

## Stargazers over time
Expand Down

0 comments on commit 5a51eca

Please sign in to comment.