Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit a88deae

Browse files
committed
added continuous delivery ubuntu
1 parent 5c7cb77 commit a88deae

File tree

4 files changed

+129
-35
lines changed

4 files changed

+129
-35
lines changed

.github/workflows/cd.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CD (continuous delivery)
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
env:
8+
IMAGE_NAME: dbscan-octrees
9+
10+
jobs:
11+
ci:
12+
uses: ./.github/workflows/lint_and_test.yml
13+
deploy:
14+
runs-on: ubuntu-22.04
15+
needs: [ci]
16+
name: cd / Deploy
17+
18+
steps:
19+
- name: Clone Repository
20+
uses: actions/checkout@v3
21+
with:
22+
submodules: recursive
23+
24+
- name: Download artifact
25+
uses: actions/download-artifact@master
26+
with:
27+
name: build
28+
path: ${{github.workspace}}/install
29+
30+
- name: Install PCL
31+
run: sudo apt-get -qq -o=Dpkg::Use-Pty=0 install libpcl-dev
32+
33+
- name: Docker meta
34+
id: meta
35+
uses: docker/metadata-action@v4
36+
with:
37+
# list of Docker images to use as base name for tags
38+
images: |
39+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
40+
# generate Docker tags based on the following events/attributes
41+
tags: |
42+
type=semver,pattern={{version}}
43+
type=sha
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v2
47+
48+
- name: Log in to registry
49+
# This is where you will update the PAT to GITHUB_TOKEN
50+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
51+
52+
- name: Build and push
53+
uses: docker/build-push-action@v3
54+
with:
55+
context: .
56+
file: Dockerfile.release
57+
push: true
58+
tags: ${{ steps.meta.outputs.tags }}
59+
labels: ${{ steps.meta.outputs.labels }}
60+
cache-from: type=registry,ref=ghcr.io/danieltobon43/${{ env.IMAGE_NAME }}:latest
61+
cache-to: type=inline

.github/workflows/ci.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,11 @@
1-
name: Continuous integration
1+
name: CI (continuous integration)
22

33
on:
44
push:
55
paths-ignore: ["**.md"]
66
branches-ignore: ["master"]
7+
workflow_call:
78

89
jobs:
9-
build:
10-
runs-on: ubuntu-20.04
11-
name: Building Check
12-
steps:
13-
- name: Clone Repository
14-
uses: actions/checkout@v3
15-
with:
16-
submodules: recursive
17-
18-
- name: Build, Test and Coverage
19-
uses: danielTobon43/PCL-Build-Action@testing
20-
with:
21-
build_tests: true
22-
build_coverage: false
23-
24-
# - name: LCOV Minimum Coverage Checker
25-
# uses: terencetcf/github-actions-lcov-minimum-coverage-checker@v1
26-
# with:
27-
# coverage-file: coverage.info
28-
29-
lint:
30-
name: Formatting Check
31-
runs-on: ubuntu-20.04
32-
33-
steps:
34-
- uses: actions/checkout@v2
35-
- name: Run clang-format style check for C/C++/Protobuf programs.
36-
uses: jidicula/clang-format-action@v4.5.0
37-
with:
38-
clang-format-version: "10"
39-
check-path: "."
40-
exclude-regex: "external"
10+
ci:
11+
uses: ./.github/workflows/lint_and_test.yml
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Lint & Test
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
BUILD_TYPE: Release
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-22.04
12+
name: Build Check
13+
steps:
14+
- name: Clone Repository
15+
uses: actions/checkout@v3
16+
with:
17+
submodules: recursive
18+
19+
- name: Install PCL
20+
run: sudo apt-get -qq -o=Dpkg::Use-Pty=0 install libpcl-dev
21+
22+
- name: Configure CMake
23+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=install
24+
25+
- name: Build app
26+
run: cmake --build ${{github.workspace}}/build --config $BUILD_TYPE
27+
28+
- name: Install app
29+
run: cmake --install build
30+
31+
- name: Test app
32+
run: ${{github.workspace}}/build/app
33+
34+
- name: Store artifact
35+
uses: actions/upload-artifact@master
36+
with:
37+
name: build
38+
path: ${{github.workspace}}/install
39+
40+
lint:
41+
needs: [build]
42+
name: Formatting Check
43+
runs-on: ubuntu-20.04
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Run clang-format style check for C/C++/Protobuf programs.
48+
uses: jidicula/clang-format-action@v4.5.0
49+
with:
50+
clang-format-version: "10"
51+
check-path: "."
52+
exclude-regex: "external"
53+
54+
test:
55+
needs: [build]
56+
name: Tests Check
57+
runs-on: ubuntu-20.04
58+
steps:
59+
- uses: actions/checkout@v2
60+
- run: echo "🍏 This job's status is ${{ job.status }}."

.github/workflows/release.yml renamed to .github/workflows/release-alpine.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,7 @@ jobs:
5757
[ "$VERSION" == "master" ] && VERSION=latest
5858
echo IMAGE_ID=$IMAGE_ID
5959
echo VERSION=$VERSION
60-
docker tag $IMAGE_NAME $IMAGE_ID:latest
61-
docker push $IMAGE_ID:latest
60+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION-alpine
61+
docker tag $IMAGE_NAME $IMAGE_ID:latest-alpine
62+
docker push $IMAGE_ID:$VERSION-alpine
63+
docker push $IMAGE_ID:latest-alpine

0 commit comments

Comments
 (0)