aoc_2024/.github/workflows/solve.yaml

64 lines
2.2 KiB
YAML
Raw Permalink Normal View History

2024-12-02 13:06:26 +00:00
name: Solve
on:
push:
branches:
- main
jobs:
example-action:
runs-on: ubuntu-latest
2024-12-05 13:43:19 +00:00
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 }}
2024-12-02 13:06:26 +00:00
steps:
2024-12-02 13:06:26 +00:00
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
2024-12-05 13:43:19 +00:00
distribution: 'corretto'
2024-12-02 13:06:26 +00:00
java-version: '21'
2024-12-02 13:06:27 +00:00
- uses: https://github.com/fwilhe2/setup-kotlin@main
- name: Run tests
2024-12-03 07:28:42 +00:00
run: ./simpletest.sh validate
2024-12-02 13:06:27 +00:00
- name: Solutions
run: |
set -e
for script in $(ls *.kts | sort -r); do
2024-12-05 13:43:19 +00:00
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 "Running $script with input from $dayname" | tee -a solutions-output.txt
echo -n "$input_var" | kotlin $script 2>&1 | tee -a solutions-output.txt
2024-12-02 13:06:27 +00:00
done
2024-12-02 13:06:27 +00:00
- name: Upload Solutions Output
2024-12-02 13:06:27 +00:00
uses: actions/upload-artifact@v3
2024-12-02 13:06:27 +00:00
with:
name: solutions-output
path: solutions-output.txt