[Fix] short pwd bash compatible #1238
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- 'dotfiles_template/*.md' | |
- 'docs/**' | |
- 'doc/**' | |
- '*.md' | |
- '**/*.md' | |
jobs: | |
build: | |
name: 🚀 Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-latest | |
- ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set current repository for pull requests | |
run: | | |
echo "DOTLY_PR_REPOSITORY=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_ENV | |
- name: Set current repository and branch | |
run: | | |
echo "DOTLY_REPOSITORY=${DOTLY_PR_REPOSITORY:-gtrabanco/sloth}" >> $GITHUB_ENV | |
echo "DOTLY_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | |
echo "DOTLY_ENV=CI" >> $GITHUB_ENV | |
- name: Install | |
run: echo "$HOME/.dotfiles" | bash installer | |
- name: Speed test ENV | |
run: | | |
echo "DOTLY_ENV=PROD" >> $GITHUB_ENV | |
echo "DOTFILES_PATH=${HOME}/.dotfiles" >> $GITHUB_ENV | |
echo "SLOTH_PATH=${HOME}/.dotfiles/modules/sloth" >> $GITHUB_ENV | |
echo "ZIM_HOME=${HOME}/.dotfiles/shell/zhs/zimfw" >> $GITHUB_ENV | |
echo "DOTLY_ENV=PROD" >> $GITHUB_ENV | |
- name: ZSH Speed test | |
run: | | |
echo "DOTFILES_PATH: $DOTFILES_PATH" | |
echo "SLOTH_PATH: ${SLOTH_PATH:-${DOTLY_PATH:-}}" | |
echo "ZIM_HOME: $ZIM_HOME" | |
! command -v zsh &>/dev/null && echo "ZSH Shell not found" && exit | |
zsh -c ". \"$HOME/.dotfiles/modules/sloth/shell/init-sloth.sh\"; \"${SLOTH_PATH}/bin/dot\" shell zsh test_performance | tee -a \"${HOME}/dotly.log\"" | |
- name: BASH Speed test | |
run: | | |
echo "DOTFILES_PATH: $DOTFILES_PATH" | |
echo "SLOTH_PATH: ${SLOTH_PATH:-${DOTLY_PATH:-}}" | |
echo "ZIM_HOME: $ZIM_HOME" | |
! command -v bash &>/dev/null && echo "BASH Shell not found" && exit | |
bash -c ". \"$HOME/.dotfiles/modules/sloth/shell/init-sloth.sh\"; \"${SLOTH_PATH}/bin/dot\" shell bash test_performance | tee -a \"${HOME}/dotly.log\"" | |
- name: Debug | |
if: ${{ always() }} | |
run: | | |
echo "DOTLY_REPOSITORY: $DOTLY_REPOSITORY" | |
echo "DOTLY_BRANCH: $DOTLY_BRANCH" | |
echo "DOTLY_ENV: $DOTLY_ENV" | |
cat "$HOME/dotly.log" | |
static-analysis: | |
runs-on: ubuntu-latest | |
name: 💿 Static analysis | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set needed environment variables | |
run: | | |
echo "DOTLY_PATH=$PWD" >> $GITHUB_ENV | |
- name: 💿 Static analysis | |
run: bash scripts/self/static_analysis | |
lint: | |
runs-on: ubuntu-latest | |
name: 💅 Lint | |
steps: | |
- uses: actions/checkout@v2 | |
# Thanks to @borjapazr in https://github.com/CodelyTV/dotly/pull/191 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.16.1' | |
- name: Set needed environment variables | |
run: | | |
echo "DOTLY_PATH=$PWD" >> $GITHUB_ENV | |
echo "PATH=$PATH:$HOME/go/bin" >> $GITHUB_ENV | |
- name: 📥 Install shfmt | |
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest | |
- name: 💅 Lint bash files and apply linting patches | |
run: | | |
bash scripts/self/lint || { | |
. "scripts/core/src/_main.sh" | |
output::write "Apply patches by using \`dot core lint\`" | |
exit 1 | |
} |