Skip to content

Commit

Permalink
ci: make sure shfmt is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Oct 24, 2024
1 parent 787ed71 commit 0df5924
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Run Tests
run: |
./lib/bashunit --parallel tests/first_time_setup/unit/**/*.sh
bash tests/first_time_setup/e2e/test_e2e.sh
TERM=xterm-256color bash tests/first_time_setup/e2e/test_e2e.sh
release:
runs-on: ubuntu-22.04
Expand Down
37 changes: 24 additions & 13 deletions tests/first_time_setup/e2e/test_e2e.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
#!/bin/bash

set -euo pipefail
test::build() {
local -r pip_shfmt=$(command -v shfmt 2>/dev/null)
if [[ -z ${pip_shfmt} ]]; then pip install shfmt-py 1>/dev/null; fi
./build.sh 1>/dev/null
}

declare -xr DRY_MODE=true
declare -xr JURISDICTION_NAME="L'Île-d'Yeu"
declare -xr REPOSITORY_URL='https://github.com/openfisca/openfisca-ile-d_yeu'
test::run() {
echo -e "$(./first-time-setup.sh 2>&1 1>/dev/null)"
}

source 'src/first_time_setup/utils/colours.sh'
main() {
set -euo pipefail
declare -xr DRY_MODE=true
declare -xr JURISDICTION_NAME="L'Île-d'Yeu"
declare -xr REPOSITORY_URL='https://github.com/openfisca/openfisca-ile-d_yeu'
source 'src/first_time_setup/utils/colours.sh'
test::build
local -r result=$(test::run)

./build.sh 1>/dev/null
result=$(./first-time-setup.sh 2>&1 1>/dev/null)
if [[ -n ${result} ]]; then
colour::fail 'First time setup failed with error:'
colour::logs "${result}"
exit 1
fi

if [[ -n "${result}" ]]; then
colour::fail 'First time setup failed with error:'
colour::logs "${result}"
exit 1
fi
colour::done 'First time setup ran successfully!'
}

colour::done 'First time setup ran successfully!'
main "$@"

0 comments on commit 0df5924

Please sign in to comment.