-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (89 loc) · 2.66 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
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: ubuntu:22.04
steps:
- name: Get current date
id: date
run: echo "name=date::$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: basic install
run: |
apt-get update &&
apt-get install -y ansible
- name: ansible version
run: |
ansible-playbook --version
- uses: actions/checkout@v4
- 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 }}
- name: ansible
run: |
ansible-playbook -i ansible/hosts/localhost.ini ansible/setup_dev_environment.yml --connection local --become -e ansible_user=ubuntu
- name: export repos file
run: vcs export --exact robotx_ws/src > robotx.repos
- uses: actions/upload-artifact@v4
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@v4
- name: basic install
run: |
sudo apt install ansible
- name: run ansible and install docker
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@v4
- name: basic install
run: |
sudo apt install ansible
- name: run ansible and download dataset
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 }}