-
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.
Refactor macOS setup scripts for enhanced configurability and testing
- Updated README.md to improve clarity and structure, introducing environment groups for better organization of tools and applications. - Refactored setup_config.sh to define package groups and their configurations, allowing for easier management of installations. - Enhanced setup_functions.sh with new functions for listing package groups and improved argument parsing for enabling/disabling groups. - Added comprehensive test suite with unit, integration, and system tests to ensure reliability and functionality of the setup scripts. - Introduced GitHub Actions workflows for automated testing and dependency updates. - Added VSCode settings for improved development experience. This commit significantly improves the usability and maintainability of the macOS setup scripts.
- Loading branch information
1 parent
249c869
commit ea521d1
Showing
11 changed files
with
1,082 additions
and
201 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,46 @@ | ||
name: Test and Update | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up test environment | ||
run: | | ||
chmod +x tests/run_tests.sh | ||
chmod +x tests/unit/setup_functions_test.sh | ||
chmod +x tests/integration/setup_integration_test.sh | ||
chmod +x tests/system/setup_system_test.sh | ||
- name: Run tests | ||
run: | | ||
./tests/run_tests.sh | ||
- name: Update test status badge | ||
if: success() | ||
run: | | ||
sed -i '' '/!\[Tests\]/d' README.md | ||
sed -i '' '/<div align="center">/a\'$'\n''[![Tests](https://github.com/${{ github.repository }}/actions/workflows/test.yml/badge.svg)](https://github.com/${{ github.repository }}/actions/workflows/test.yml)\'$'\n' README.md | ||
- name: Commit README changes | ||
if: success() && github.event_name == 'push' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add README.md | ||
git diff --quiet && git diff --staged --quiet || git commit -m "docs: update test status badge [skip ci]" | ||
- name: Push changes | ||
if: success() && github.event_name == 'push' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: main |
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,48 @@ | ||
name: Update Dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight | ||
workflow_dispatch: # Allow manual trigger | ||
|
||
jobs: | ||
update-deps: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Homebrew | ||
run: | | ||
brew update | ||
- name: Check for outdated packages | ||
id: check-outdated | ||
run: | | ||
# Get list of outdated packages | ||
OUTDATED=$(brew outdated) | ||
if [ -n "$OUTDATED" ]; then | ||
echo "outdated=true" >> $GITHUB_OUTPUT | ||
echo "packages<<EOF" >> $GITHUB_OUTPUT | ||
echo "$OUTDATED" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Create Pull Request | ||
if: steps.check-outdated.outputs.outdated == 'true' | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "chore: update homebrew package versions" | ||
title: "chore: update homebrew packages" | ||
body: | | ||
This PR updates the following Homebrew packages to their latest versions: | ||
``` | ||
${{ steps.check-outdated.outputs.packages }} | ||
``` | ||
This is an automated update triggered by the weekly dependency check. | ||
branch: update-deps | ||
base: main | ||
labels: dependencies |
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,7 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"editor.lineHighlightBackground": "#1073cf2d", | ||
"editor.lineHighlightBorder": "#9fced11f", | ||
"terminal.background": "#00000000" | ||
} | ||
} |
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
Oops, something went wrong.