Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
naimo84 committed Aug 16, 2023
0 parents commit 6dd9486
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: CI
'on':
pull_request:
push:
branches:
- main
schedule:
- cron: "0 5 * * 4"

jobs:

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v2

- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install yamllint ansible ansible-lint

- name: Lint code.
run: |
yamllint .
ansible-lint
integration:
name: Integration
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-12
- macos-11
- ubuntu-latest

steps:
- name: Check out the codebase.
uses: actions/checkout@v2

- name: Uninstall GitHub Actions' built-in Homebrew.
run: tests/uninstall-homebrew.sh

Check failure on line 49 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Lint

49:1 [trailing-spaces] trailing spaces
- name: Install test dependencies.
run: |
sudo pip3 install --upgrade pip
sudo pip3 install ansible
- name: Set up the test environment.
run: |

Check failure on line 56 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Lint

56:15 [trailing-spaces] trailing spaces
ansible-galaxy install -r requirements.yml
- name: Test the playbook's syntax.
run: ansible-playbook main.yml --syntax-check

- name: Test the playbook.
run: ansible-playbook main.yml
env:
ANSIBLE_FORCE_COLOR: '1'

- name: Idempotence check.
run: |
idempotence=$(mktemp)
ansible-playbook main.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)

Check failure on line 71 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Lint

71:81 [line-length] line too long (151 > 80 characters)
env:
ANSIBLE_FORCE_COLOR: '1'

Check failure on line 73 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Lint

73:35 [new-line-at-end-of-file] no new line character at the end of file
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible-galaxy install -r requirements.yml
35 changes: 35 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- hosts: localhost
connection: local
vars:
ansible_connection: local
dotfiles_repo: "https://github.com/naimo84/dotfiles.git"
dotfiles_repo_version: main
dotfiles_repo_accept_hostkey: false
dotfiles_repo_local_destination: "~/Documents/dotfiles"

dotfiles_home: "~"
dotfiles_files:
- .zshrc
- .zshenv
- .bashrc
- .config/starship.toml
- .config/nvim
roles:
- role: geerlingguy.mac.homebrew
tags: ["homebrew"]
- role: geerlingguy.dotfiles
- role: elliotweiser.osx-command-line-tools
tasks:
- name: "add homebrew tools"
homebrew: name={{ item }} state=present
with_items:
- age
- yamllint
- starship
- neovim
- fd
- exa
- bat
- jq
- fzf
6 changes: 6 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
roles:
- name: geerlingguy.dotfiles

Check failure on line 3 in requirements.yml

View workflow job for this annotation

GitHub Actions / Lint

3:31 [trailing-spaces] trailing spaces
- name: elliotweiser.osx-command-line-tools
collections:
- name: geerlingguy.mac

Check failure on line 6 in requirements.yml

View workflow job for this annotation

GitHub Actions / Lint

6:26 [new-line-at-end-of-file] no new line character at the end of file
13 changes: 13 additions & 0 deletions tests/uninstall-homebrew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#
# Uninstalls Homebrew using the official uninstall script.

# Download and run the uninstall script.
curl -sLO https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh
chmod +x ./uninstall.sh
sudo ./uninstall.sh --force

# Clean up Homebrew directories.
sudo rm -rf /usr/local/Homebrew
sudo rm -rf /usr/local/Caskroom
sudo rm -rf /usr/local/bin/brew

0 comments on commit 6dd9486

Please sign in to comment.