-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6dd9486
Showing
5 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
|
||
- name: Install test dependencies. | ||
run: | | ||
sudo pip3 install --upgrade pip | ||
sudo pip3 install ansible | ||
- name: Set up the test environment. | ||
run: | | ||
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) | ||
env: | ||
ANSIBLE_FORCE_COLOR: '1' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ansible-galaxy install -r requirements.yml |
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
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
roles: | ||
- name: geerlingguy.dotfiles | ||
- name: elliotweiser.osx-command-line-tools | ||
collections: | ||
- name: geerlingguy.mac | ||
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
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 |