This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 160
102 lines (90 loc) · 2.97 KB
/
main.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
name: Main
on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.gitignore'
- 'crowdin.yml'
- 'data/translations/**'
pull_request:
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.gitignore'
- 'crowdin.yml'
- 'data/translations/**'
jobs:
validate-metainfo:
name: Validate metainfo
runs-on: ubuntu-20.04
steps:
- name: Clone repo
uses: actions/checkout@v3
- name: Install AppStream metadata utility
run: |
sudo apt-get update
sudo apt-get install appstream-util
- name: Validate metainfo
run: appstream-util validate-relax data/io.crow_translate.CrowTranslate.metainfo.xml
format:
name: Format
runs-on: ubuntu-20.04
steps:
- name: Clone repo
uses: actions/checkout@v3
- name: Check formatting
uses: DoozyX/clang-format-lint-action@v0.15
with:
clangFormatVersion: 12
build:
name: Build
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]
include:
- os: ubuntu-20.04
extra-cmake-arguments: >-
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror"
- os: windows-2019
extra-cmake-arguments: >-
-D CMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
-D VCPKG_TARGET_TRIPLET=x64-windows
-D VCPKG_INSTALL_OPTIONS=--clean-after-build
-D X_VCPKG_APPLOCAL_DEPS_INSTALL=ON
-D CMAKE_CXX_FLAGS="/experimental:external /external:anglebrackets /external:W0 /W4 /wd4530 /WX"
-D CMAKE_CXX_CLANG_TIDY='clang-tidy;--warnings-as-errors=*'
runs-on: ${{ matrix.os }}
steps:
- name: Clone repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install apt packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install extra-cmake-modules libqt5x11extras5-dev qttools5-dev qtmultimedia5-dev libkf5wayland-dev libtesseract-dev ninja-build
- name: Install vcpkg
uses: lukka/run-vcpkg@v11.4
if: runner.os == 'Windows'
with:
vcpkgJsonGlob: vcpkg.json
- name: Setup MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
# See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4766#note_1091927
- name: Downgrade CMake
if: runner.os == 'Windows'
uses: lukka/get-cmake@v3.21.2
- name: Build
run: |
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D WITH_PORTABLE_MODE=ON -DCMAKE_INSTALL_PREFIX=install ${{ matrix.extra-cmake-arguments }}
cmake --build build --parallel 2 --target install
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: crow-translate-${{ matrix.os }}
path: install/**