Skip to content

Build & Test

Build & Test #232

Workflow file for this run

name: build-and-test
run-name: Build & Test
on:
workflow_dispatch:
inputs:
ubuntu:
description: 'Build & Test on Ubuntu latest ?'
default: true
required: true
type: boolean
macos:
description: 'Build & Test on macOS latest ?'
default: false
required: true
type: boolean
push:
branches:
- '**'
paths:
- 'bin/**'
- 'dotfiles/**'
- 'tests/**'
- '*.bash'
fork:
branches:
- '**'
pull_request:
branches:
- '**'
paths:
- 'bin/**'
- 'dotfiles/**'
- 'tests/**'
- '*.bash'
permissions:
contents: write
env:
JOB_NAME: "HomeSetup-Build"
jobs:
build:
runs-on: 'ubuntu-latest'
env:
HHS_LOG_DIR: '/Users/runner/.hhs/log'
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ vars.PYTHON_VERSION }}
- name: Update PIP
run: pip install --upgrade pip
- name: Install HomeSetup with Prefix
run: |
if ./install.bash -r -p "${{ github.workspace }}"; then
echo "${{ github.workspace }}" > "${HOME}/.hhs-prefix"
echo -e "\nInstallation information:"
echo -e "SHELL: ${SHELL}"
echo -e " HOME: ${HOME}"
echo -e " USER: ${USER}\n"
echo -en "Loading bash profile..."
if source "${HOME}"/.bashrc; then echo "OK"; else echo "FAILED"; fi
echo "HHS_LOG_DIR=$(echo ${HHS_LOG_DIR})" >> $GITHUB_ENV
__hhs tests
exit 0
else
echo "HHS_LOG_DIR=$(echo ${HOME}/install.log)" >> $GITHUB_ENV
exit 1
fi
- name: Upload installation logs (success)
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: "success-install-logs"
path: "${{ env.HHS_LOG_DIR }}"
- name: Upload installation logs (failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: "failure-install-logs"
path: "${{ env.HHS_LOG_DIR }}"