ansible #1498
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |