-
Notifications
You must be signed in to change notification settings - Fork 13
133 lines (107 loc) · 4.47 KB
/
linux.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Copyright 2020-2021 Alibaba Group Holding Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI on Linux
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
MAVEN_ARGS: "--no-transfer-progress"
LLVM11_HOME: /opt/llvm11.0.0
jobs:
fastffi-ci:
runs-on: ubuntu-20.04
container: vineyardcloudnative/manylinux-llvm:2014-11.0.0
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
curl -L https://git.io/vaHfR --output /usr/local/bin/screenfetch
chmod +x /usr/local/bin/screenfetch
yum install -y ccache
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
java-package: 'jdk'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set up Maven
uses: stCarolas/setup-maven@master
with:
maven-version: 3.8.4
- name: Validate settings
run: |
mkdir -p /root/.m2
cp /github/home/.m2/settings.xml /root/.m2/settings.xml || true
cat /root/.m2/settings.xml
- name: Check environment
run: |
export PATH=$LLVM11_HOME/bin:$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
echo "JAVA_HOME = ${JAVA_HOME}"
echo "MAVEN_HOME = ${MAVEN_HOME}"
echo "PATH = ${PATH}"
# check os
echo "########################################### checking os ..."
screenfetch
# check clang
echo "########################################### checking clang ..."
$LLVM11_HOME/bin/clang --version
# check llvm
echo "########################################### checking llvm ..."
$LLVM11_HOME/bin/llc --version
# check clang
echo "########################################### checking cmake ..."
cmake --version
# check java
echo "########################################### checking java ..."
java -version
# check mvn
echo "########################################### checking maven ..."
mvn --version
- name: Build, test and install
run: |
export PATH=$PATH:$LLVM11_HOME/bin:$JAVA_HOME/bin:$MAVEN_HOME/bin
./build.sh
- name: Publish package
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'alibaba/fastFFI' }}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_MAVEN_GPG_PASSPHRASE }}
run: |
export PATH=$PATH:$LLVM11_HOME/bin:$JAVA_HOME/bin:$MAVEN_HOME/bin
# staging profile id: obtained from "mvn nexus-staging:rc-list-profiles"
# staging repository id: obtained from "mvn nexus-staging:rc-open"
mvn --batch-mode deploy \
-Prelease \
-Dmaven.deploy.skip=true \
-Dstaging.repository=${{ secrets.OSSRH_MAVEN_STAGING_REPOSITORY_ID }} \
-DstagingProfileId=${{ secrets.OSSRH_MAVEN_STAGING_PROFILE_ID }} \
-DstagingRepositoryId=${{ secrets.OSSRH_MAVEN_STAGING_REPOSITORY_ID }} \
-Dgpg.passphrase=${{ secrets.OSSRH_MAVEN_GPG_PASSPHRASE }} \
-DskipTests
- name: Packaging artifacts inside the container
run: |
tar zcvf fastffi-jars-x86-64-manylinux2014.tar.gz /root/.m2/repository/com/alibaba/fastffi
- uses: actions/upload-artifact@v1
with:
name: fastffi-jars-x86-64-manylinux2014
path: fastffi-jars-x86-64-manylinux2014.tar.gz