Skip to content

Commit

Permalink
chore: add test job at CI
Browse files Browse the repository at this point in the history
  • Loading branch information
YasminTeles committed Mar 10, 2024
1 parent 60c91d0 commit 57060f4
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 4 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,62 @@ jobs:
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

Tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: macOS-latest
shell: bash
- os: ubuntu-latest
shell: bash
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Clean up linuxOS
if: runner.os != 'macOS'
run: sudo apt-get install build-essential

- name: Cleanup macOS
if: runner.os == 'macOS'
run: |
sudo rm -rf /Applications/Xcode.app \
/Library/Developer/CommandLineTools
sudo xcode-select --reset
- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
env:
NONINTERACTIVE: 1

- name: Set up Homebrew PATH
run: |
if [[ "${{ runner.os }}" = "macOS" ]]
then
echo "/usr/local/bin:/usr/bin:/bin" >> "${GITHUB_PATH}"
else
echo "/home/linuxbrew/.linuxbrew/bin:/usr/bin:/bin" >> "${GITHUB_PATH}"
fi
- name: Run install script
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/YasminTeles/dotfiles/main/install.sh)"
env:
CI: true

- name: Show the Home directory
run: |
cd ~
ls -la
- name: Run uninstall script
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/YasminTeles/dotfiles/main/uninstall.sh)"
env:
CI: true

- name: Show the Home directory
run: |
cd ~
ls -la
8 changes: 6 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ function step_msg {
}

# -- Get some information -----------------------------------------------------
printf "Please enter some information.\n"
read -p "What is your email? " GIT_EMAIL
if [ "$CI" = true ] ; then
[email protected]
else
printf "Please enter some information.\n"
read -p "What is your email? " GIT_EMAIL
fi

printf "\nPlease wait! It will configure your environment.\n"

Expand Down
8 changes: 6 additions & 2 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ function step_msg {
}

echo "This script will remove all configurations of the environment."
read -p "Are you sure you want to proceed? (y/n) " CONFIRM

if [[ $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]]
if [ ! $CI ]
then
read -p "Are you sure you want to proceed? (y/n) " CONFIRM
fi

if [[ $CI|| $CONFIRM == [yY] || $CONFIRM == [yY][eE][sS] ]]
then
printf "\nPlease wait! Proceeding with the removal of all configurations...\n"

Expand Down

0 comments on commit 57060f4

Please sign in to comment.