Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* text=auto

inputs/*.txt text eol=lf
inputs.tar.gpg binary
16 changes: 16 additions & 0 deletions .github/actions/extract-inputs/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Extract inputs
description: Extract input files from the encrypted tarball
inputs:
encryption-key:
description: The encryption key for the input files
required: true

runs:
using: composite
steps:
- env:
ENCRYPTION_KEY: ${{ inputs.encryption-key }}
run: |
# Extract inputs
"${GITHUB_ACTION_PATH}/extract.sh"
shell: bash
12 changes: 12 additions & 0 deletions .github/actions/extract-inputs/extract.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -euo pipefail

if [[ -z "${ENCRYPTION_KEY}" ]]; then
echo "::error::ENCRYPTION_KEY is empty"
exit 1
fi

echo "::group::Extract inputs"
mise run inputs:extract
echo "::endgroup::"
1 change: 1 addition & 0 deletions .github/workflows/ci-python-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
if: inputs.directory != 'aoc-main'
needs: uv-cache
uses: ./.github/workflows/python-run.yaml
secrets: inherit

test-pytest:
if: always() && contains(fromJSON('["skipped", "success"]'), needs.uv-cache.result)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-solvers-cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
# Checks
build-test-run:
uses: ./.github/workflows/cpp-build-test-run.yaml
secrets: inherit
with:
homebrew-downloads-hash-from-prepare-macos: ${{ inputs.homebrew-downloads-hash-from-prepare-macos }}
homebrew-downloads-hash-from-prepare-ubuntu: ${{ inputs.homebrew-downloads-hash-from-prepare-ubuntu }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-solvers-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
# Checks
build-test-run:
uses: ./.github/workflows/rust-build-test-run.yaml
secrets: inherit

check-rustfmt:
uses: ./.github/workflows/mise-task.yaml
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ jobs:
- uv-cache-aoc-main-macos
- uv-cache-aoc-main-ubuntu
uses: ./.github/workflows/ci-solvers-cpp.yaml
secrets: inherit
with:
homebrew-downloads-hash-from-prepare-macos: ${{ needs.homebrew-cache-macos.outputs.downloads-hash }}
homebrew-downloads-hash-from-prepare-ubuntu: ${{ needs.homebrew-cache-ubuntu.outputs.downloads-hash }}
Expand All @@ -132,6 +133,7 @@ jobs:
- mise-cache-ubuntu
- uv-cache-aoc-main-ubuntu
uses: ./.github/workflows/ci-python-project.yaml
secrets: inherit
with:
directory: solvers/python

Expand All @@ -143,6 +145,7 @@ jobs:
- uv-cache-aoc-main-macos
- uv-cache-aoc-main-ubuntu
uses: ./.github/workflows/ci-solvers-rust.yaml
secrets: inherit

# Check for all green CI
check:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/cpp-build-test-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ jobs:
with:
directory: aoc-main

- name: Extract inputs
uses: ./.github/actions/extract-inputs
with:
encryption-key: ${{ secrets.INPUTS_ENCRYPTION_KEY }}

- name: Run all solutions
env:
AOC_CPP_SKIP_PREPARE: "1"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/python-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ jobs:
with:
directory: solvers/python

- name: Extract inputs
uses: ./.github/actions/extract-inputs
with:
encryption-key: ${{ secrets.INPUTS_ENCRYPTION_KEY }}

- name: Run aoc
run: mise run aoc:all -- --solver python
6 changes: 6 additions & 0 deletions .github/workflows/rust-build-test-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ jobs:
with:
directory: aoc-main

- if: matrix.run
name: Extract inputs
uses: ./.github/actions/extract-inputs
with:
encryption-key: ${{ secrets.INPUTS_ENCRYPTION_KEY }}

- if: matrix.run
name: Run all solutions
env:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.venv/
__pycache__/

/inputs/

/solvers/cpp/build*/
/solvers/cpp/CMakeUserPresets*.json

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ uv.lock
/solvers/cpp/cmake-conan/

/inputs/*.txt
/inputs.json

/aoc-main/**/*.py
/solvers/cpp/**/*.cpp
Expand Down
31 changes: 31 additions & 0 deletions inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
"2022-01.txt",
"2022-02.txt",
"2022-03.txt",
"2022-04.txt",
"2022-05.txt",
"2022-06.txt",
"2023-01.txt",
"2023-02.txt",
"2023-03.txt",
"2023-04.txt",
"2023-05.txt",
"2023-06.txt",
"2023-07.txt",
"2023-08.txt",
"2023-09.txt",
"2023-10.txt",
"2023-11.txt",
"2023-12.txt",
"2023-13.txt",
"2023-14.txt",
"2023-15.txt",
"2023-16.txt",
"2023-17.txt",
"2023-18.txt",
"2023-19.txt",
"2023-20.txt",
"2024-05.txt",
"2024-06.txt",
"2024-07.txt"
]
Binary file added inputs.tar.gpg
Binary file not shown.
Loading
Loading