Skip to content

Dev Environment Contingency #10

Dev Environment Contingency

Dev Environment Contingency #10

Workflow file for this run

# workflow to ensure development tooling and environment is properly set up
name: Dev Environment Contingency
run-name: Dev Environment Contingency
permissions:
contents: write
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
id: checkout
- name: Install go
id: install-go
uses: actions/setup-go@v3
with:
go-version: 1.22.5
- name: Install Task
id: install-task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run all tasks in the workflow
id: run-all-tasks
run: |
go install github.com/segmentio/golines@latest
# Capture the list of all tasks
OUTPUT=$(task --list-all)
# Parse the list of tasks from the output
TASKS=$(echo "$OUTPUT" | grep -oP '(?<=\* ).*(?=:)')
# Check if TASKS variable is not empty
if [ -z "$TASKS" ]; then
echo "No tasks found."
exit 1
fi
# Iterate over each task and execute it
for TASK in $TASKS; do
echo "Executing task: $TASK"
task "$TASK"
echo "Completed task: $TASK"
echo "----------------------------"
done