blob: cc2d1c90f93873e4ee070599b362d2c55aae3531 [file] [log] [blame]
Jiayu Liubcac9782022-05-07 08:35:09 +08001name: "Build"
Jiayu Liuc77d91a2022-05-03 20:55:50 +08002
Jiayu Liu6a61c4e2022-04-29 01:25:39 +08003on:
4 push:
Jiayu Liubcac9782022-05-07 08:35:09 +08005 branches: ["*"]
Jiayu Liu6a61c4e2022-04-29 01:25:39 +08006 pull_request:
Jiayu Liubcac9782022-05-07 08:35:09 +08007 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
Jiayu Liubcac9782022-05-07 08:35:09 +080063 cache: "gradle"
Jiayu Liuc77d91a2022-05-03 20:55:50 +080064
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
Jiayu Liubcac9782022-05-07 08:35:09 +080080 - name: Run spotlessCheck for Java
Jiayu Liu53ec0822022-05-06 12:56:42 +080081 run: |
82 cd lib/java
83 gradle spotlessCheck
84
Jiayu Liubcac9782022-05-07 08:35:09 +080085 - name: Run ktfmtCheck for Kotlin
86 run: |
87 cd lib/kotlin
88 gradle ktfmtCheck
89
Jiayu Liuc77d91a2022-05-03 20:55:50 +080090 - name: Run bootstrap
91 run: ./bootstrap.sh
92
93 - name: Run configure
94 run: |
95 ./configure \
96 --disable-debug \
97 --disable-tests \
98 --disable-dependency-tracking \
99 --without-cpp \
100 --without-c_glib \
101 --with-java \
102 --with-kotlin \
103 --without-python \
104 --without-py3 \
105 --without-ruby \
106 --without-haxe \
107 --without-netstd \
108 --without-perl \
109 --without-php \
110 --without-php_extension \
111 --without-dart \
112 --without-erlang \
113 --without-go \
114 --without-d \
115 --without-nodejs \
116 --without-nodets \
117 --without-lua \
118 --without-rs \
119 --without-swift
120
121 - uses: actions/download-artifact@v3
122 with:
123 name: thrift-compiler
124 path: compiler/cpp
125
126 - name: Run thrift-compiler
127 run: |
128 chmod a+x compiler/cpp/thrift
129 compiler/cpp/thrift -version
130
Jiayu Liubcac9782022-05-07 08:35:09 +0800131 - name: Run make for java
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800132 run: make -C lib/java
133
Jiayu Liubcac9782022-05-07 08:35:09 +0800134 - name: Run make check for java
135 run: make -C lib/java check
136
137 - name: Run make for kotlin
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800138 run: make -C lib/kotlin
Jiayu Liubcac9782022-05-07 08:35:09 +0800139
140 - name: Run make check for kotlin
141 run: make -C lib/kotlin check