Skip to content

Commit c36f253

Browse files
authored
Add CI (#64)
1 parent c7d77fe commit c36f253

File tree

7 files changed

+326
-159
lines changed

7 files changed

+326
-159
lines changed

.github/workflows/dotnet.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: .NET
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 5.0.x
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
- name: Build
23+
run: dotnet build --no-restore
24+
- name: Test
25+
run: dotnet test --no-build --verbosity normal

.github/workflows/e2e.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
build:
12+
name: e2e test
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
steps:
18+
19+
- name: Check out code into the CSharp module directory
20+
uses: actions/checkout@v2
21+
22+
- name: Cache local Maven repository
23+
uses: actions/cache@v2
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
30+
- name: Set Up IoTDB
31+
run: |
32+
sh -c "cd /tmp/ && rm -rf iotdb && git clone https://github.com/apache/iotdb.git && cd iotdb && mvn -Dmaven.test.skip=true package -am -pl server"
33+
mkdir -p target/iotdb
34+
unzip -o -q /tmp/iotdb/server/target/iotdb-server-*.zip -d target/iotdb
35+
36+
- name: Set Docker & Run Test
37+
run: |
38+
docker-compose -f samples/Apache.IoTDB.Samples/docker-compose.yml up --build --abort-on-container-exit --remove-orphans
39+
40+
- name: Clean IoTDB & Shut Down Docker
41+
run: |
42+
rm -rf /tmp/iotdb target
43+
docker-compose -f samples/Apache.IoTDB.Samples/docker-compose.yml down
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
FROM mcr.microsoft.com/dotnet/sdk:5.0
21+
WORKDIR /app
22+
23+
COPY . .
24+
CMD ["dotnet", "restore"]
25+
CMD ["dotnet", "run", "--project", "samples/Apache.IoTDB.Samples/Apache.IoTDB.Samples.csproj"]
26+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
FROM openjdk:11-jre-slim
21+
22+
RUN apt update \
23+
&& apt install -y procps && apt clean
24+
ADD target /usr/local
25+
WORKDIR /usr/local/iotdb
26+
EXPOSE 6667
27+
CMD [ "/usr/local/iotdb/sbin/start-server.sh" ]

samples/Apache.IoTDB.Samples/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public static class Program
44
{
55
public static void Main()
66
{
7-
var sessionPoolTest = new SessionPoolTest();
7+
var sessionPoolTest = new SessionPoolTest("iotdb");
88
sessionPoolTest.Test();
99
}
1010
}

0 commit comments

Comments
 (0)