blob: 227b6ce779aab0d1b6e2143e4a5c943fb172084a [file] [log] [blame]
Jiayu Liuc77d91a2022-05-03 20:55:50 +08001name: 'Build'
2
Jiayu Liu6a61c4e2022-04-29 01:25:39 +08003on:
4 push:
5 branches: [ '*' ]
6 pull_request:
7 branches: [ '*' ]
Jiayu Liuc77d91a2022-05-03 20:55:50 +08008
9env:
10 BUILD_DEPS: automake bison flex g++ git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config
11
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080012jobs:
13 # TODO windows and macos
Jiayu Liuc77d91a2022-05-03 20:55:50 +080014 compiler:
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080015 strategy:
Jiayu Liuc77d91a2022-05-03 20:55:50 +080016 matrix:
17 os: [ubuntu-18.04, ubuntu-20.04]
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080018 runs-on: ${{ matrix.os }}
19 steps:
20 - uses: actions/checkout@v3
21
22 - name: Install dependencies
23 run: |
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080024 sudo apt-get update -yq
Jiayu Liuc77d91a2022-05-03 20:55:50 +080025 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080026
27 - name: Run bootstrap
28 run: ./bootstrap.sh
29
30 - name: Run configure
31 run: ./configure --disable-debug --disable-tests --disable-libs
32
33 - name: Run make
34 run: make -j$(nproc)
35
36 - name: Run install
37 run: make install
38
39 - name: Run thrift version
40 run: /usr/local/bin/thrift -version
Jiayu Liuc77d91a2022-05-03 20:55:50 +080041
42 # only upload while building ubuntu-20.04
43 - name: Archive built thrift compiler
44 if: matrix.os == 'ubuntu-20.04'
45 uses: actions/upload-artifact@v3
46 with:
47 name: thrift-compiler
48 path: compiler/cpp/thrift
49 retention-days: 3
50
51 lib-java-kotlin:
52 needs: compiler
53 runs-on: ubuntu-20.04
54 env:
55 GRADLE_VERSION: 6.9.2
56 steps:
57 - uses: actions/checkout@v3
58
59 - uses: actions/setup-java@v3
60 with:
61 distribution: temurin
62 java-version: 11
63 cache: 'gradle'
64
65 - name: Install dependencies
66 run: |
67 sudo apt-get update -yq
68 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
69 sudo apt-get install -y wget unzip ant maven
70
71 - name: Setup gradle
72 run: |
73 wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip
74 (echo "8b356fd8702d5ffa2e066ed0be45a023a779bba4dd1a68fd11bc2a6bdc981e8f /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -)
75 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
76 sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
77 sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin
78 gradle --version
79
80 - name: Run bootstrap
81 run: ./bootstrap.sh
82
83 - name: Run configure
84 run: |
85 ./configure \
86 --disable-debug \
87 --disable-tests \
88 --disable-dependency-tracking \
89 --without-cpp \
90 --without-c_glib \
91 --with-java \
92 --with-kotlin \
93 --without-python \
94 --without-py3 \
95 --without-ruby \
96 --without-haxe \
97 --without-netstd \
98 --without-perl \
99 --without-php \
100 --without-php_extension \
101 --without-dart \
102 --without-erlang \
103 --without-go \
104 --without-d \
105 --without-nodejs \
106 --without-nodets \
107 --without-lua \
108 --without-rs \
109 --without-swift
110
111 - uses: actions/download-artifact@v3
112 with:
113 name: thrift-compiler
114 path: compiler/cpp
115
116 - name: Run thrift-compiler
117 run: |
118 chmod a+x compiler/cpp/thrift
119 compiler/cpp/thrift -version
120
121 - name: Run make java
122 run: make -C lib/java
123
124 - name: Run make kotlin
125 run: make -C lib/kotlin