-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (75 loc) · 2.22 KB
/
ci.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
name: moma CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
CATKIN_WS_PATH: moma_ws
jobs:
build-docker:
runs-on: ubuntu-latest
outputs:
docker_image_name: ${{ steps.meta.outputs.tags }}
steps:
- name: Check out moma repo
uses: actions/checkout@v3
with:
path: moma_ws/src/moma
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push docker
uses: docker/build-push-action@v4
with:
context: ./moma_ws/src/moma/docker/
file: ./moma_ws/src/moma/docker/dev.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-catkin:
needs: build-docker
runs-on: ubuntu-latest
container:
image: ${{ needs.build-docker.outputs.docker_image_name }}
steps:
- name: Git safe directory (only for running within containers)
run: git config --system --add safe.directory '*'
- name: Check out moma repo
uses: actions/checkout@v3
with:
path: moma_ws/src/moma
submodules: recursive
- run: ls
shell: bash
- name: Set up Catkin workspace
run: |
cd ${{ env.CATKIN_WS_PATH }}
source /root/.bashrc
catkin init
catkin config --extend /root/moma_dep_ws/devel
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
shell: bash
- name: Build the workspace
run: |
cd ${{ env.CATKIN_WS_PATH }}
source /root/.bashrc
catkin build --continue
shell: bash