-
Notifications
You must be signed in to change notification settings - Fork 4
115 lines (113 loc) · 3.57 KB
/
ansible.yaml
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
name: ansible
on:
schedule:
- cron: 0 0 * * *
pull_request:
paths:
- "ansible/**"
- ".github/workflows/ansible.yaml"
workflow_dispatch:
jobs:
setup_dev_environment:
name: setup_dev_environment
runs-on: ubuntu-22.04
container:
image: ubuntu:22.04
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- uses: actions/checkout@v2-beta
- name: make robotx_ws
run: |
mkdir robotx_ws
- uses: actions/cache@v2
if: ${{ github.event.label.name != 'clean_build' }}
with:
path: robotx_ws/ccache
key: ccache-${{ steps.date.outputs.date }}
- uses: actions/setup-python@v4
id: install_python
with:
python-version: 3.10.12
- uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.6.1
- name: poetry install
run: poetry install --no-interaction
# - name: install python3-apt
# run: apt update && apt install -y python3-apt
# - name: make symbolic links
# run: |
# ln -s apt_inst.*.so apt_inst.so
# ln -s apt_pkg.*.so apt_pkg.so
# working-directory: ${{ steps.install_python.outputs.python-path }}/dist-packages
- name: ansible
run: |
poetry run ansible-playbook -i ansible/hosts/localhost.ini \
ansible/setup_dev_environment.yml --connection local --become \
-e ansible_user=ubuntu \
-e ansible_python_interpreter=${{ steps.install_python.outputs.python-path }}
- name: export repos file
run: vcs export --exact robotx_ws/src > robotx.repos
- uses: actions/upload-artifact@v2
with:
name: robotx.repos
path: robotx.repos
- name: Notify Slack
uses: 8398a7/action-slack@v2
if: failure()
with:
status: ${{ job.status }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
setup_firmware:
name: setup_firmware
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2-beta
- uses: actions/setup-python@v4
with:
python-version: 3.10.12
- uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.6.1
- name: install
run: poetry install --no-interaction
- name: run ansible and install docker
run: |
poetry run ansible-galaxy install -fr ansible/roles/requirements.yml
poetry run ansible-playbook -i ansible/hosts/localhost.ini ansible/setup_mbed_workspace.yml --connection local --become -e ansible_user=ubuntu
- name: Notify Slack
uses: 8398a7/action-slack@v2
if: failure()
with:
status: ${{ job.status }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
setup_dataset:
name: setup_dataset
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2-beta
- uses: actions/setup-python@v4
with:
python-version: 3.10.12
- uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.6.1
- name: install
run: poetry install --no-interaction
- name: run ansible and download dataset
run: |
poetry run ansible-playbook -i ansible/hosts/localhost.ini ansible/setup_dataset.yml --connection local --become -e ansible_user=ubuntu
- name: Notify Slack
uses: 8398a7/action-slack@v2
if: failure()
with:
status: ${{ job.status }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}