aoc_2024/.github/workflows/solve.yaml
Logiar 12cab8af56
Some checks failed
Solve / example-action (push) Failing after 36s
Check input
2024-12-05 14:59:39 +01:00

65 lines
2.2 KiB
YAML

name: Solve
on:
push:
branches:
- main
jobs:
example-action:
runs-on: ubuntu-latest
env:
DAY01INPUT: ${{ secrets.DAY01INPUT }}
DAY02INPUT: ${{ secrets.DAY02INPUT }}
DAY03INPUT: ${{ secrets.DAY03INPUT }}
DAY04INPUT: ${{ secrets.DAY04INPUT }}
DAY05INPUT: ${{ secrets.DAY05INPUT }}
DAY06INPUT: ${{ secrets.DAY06INPUT }}
DAY07INPUT: ${{ secrets.DAY07INPUT }}
DAY08INPUT: ${{ secrets.DAY08INPUT }}
DAY09INPUT: ${{ secrets.DAY09INPUT }}
DAY10INPUT: ${{ secrets.DAY10INPUT }}
DAY11INPUT: ${{ secrets.DAY11INPUT }}
DAY12INPUT: ${{ secrets.DAY12INPUT }}
DAY13INPUT: ${{ secrets.DAY13INPUT }}
DAY14INPUT: ${{ secrets.DAY14INPUT }}
DAY15INPUT: ${{ secrets.DAY15INPUT }}
DAY16INPUT: ${{ secrets.DAY16INPUT }}
DAY17INPUT: ${{ secrets.DAY17INPUT }}
DAY18INPUT: ${{ secrets.DAY18INPUT }}
DAY19INPUT: ${{ secrets.DAY19INPUT }}
DAY20INPUT: ${{ secrets.DAY20INPUT }}
DAY21INPUT: ${{ secrets.DAY21INPUT }}
DAY22INPUT: ${{ secrets.DAY22INPUT }}
DAY23INPUT: ${{ secrets.DAY23INPUT }}
DAY24INPUT: ${{ secrets.DAY24INPUT }}
DAY25INPUT: ${{ secrets.DAY25INPUT }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
- uses: https://github.com/fwilhe2/setup-kotlin@main
- name: Run tests
run: ./simpletest.sh validate
- name: Solutions
run: |
set -e
for script in $(ls *.kts | sort -r); do
dayname=$(basename $script .kts | tr 'a-z' 'A-Z')INPUT
input_var="${!dayname}"
if [ -z "$input_var" ]; then
echo "Skipping $script: No input found for $dayname" | tee -a solutions-output.txt
continue
fi
echo "$input_var"
echo "Running $script with input from $dayname" | tee -a solutions-output.txt
echo "$input_var" | kotlin $script 2>&1 | tee -a solutions-output.txt
done
- name: Upload Solutions Output
uses: actions/upload-artifact@v3
with:
name: solutions-output
path: solutions-output.txt