Year2024.Day03 #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration ๐ฎโโ๏ธ | |
on: [push] | |
jobs: | |
lint: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout source ๐ก | |
uses: actions/checkout@v4 | |
- name: 'Install HLint ๐ก' | |
uses: haskell-actions/hlint-setup@v2 | |
with: | |
version: '3.8' | |
- name: 'Run HLint ๐' | |
uses: haskell-actions/hlint-run@v2 | |
with: | |
path: '["app/", "src/", "test/"]' | |
fail-on: warning | |
style: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout source ๐ก | |
uses: actions/checkout@v4 | |
- name: Styling ๐ | |
uses: haskell-actions/run-ormolu@v16 | |
with: | |
version: '0.7.7.0' | |
test: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout source ๐ก | |
uses: actions/checkout@v4 | |
- name: Cache ~/.stack ๐ฆ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-global- | |
- name: Cache .stack-work ๐ฆ | |
uses: actions/cache@v4 | |
with: | |
path: .stack-work | |
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }} | |
restore-keys: | | |
${{ runner.os }}-stack-work- | |
- name: Install Stack ๐ก | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: 9.6.6 | |
enable-stack: true | |
stack-version: "latest" | |
- name: Build โ | |
run: stack build --test --no-run-tests | |
- name: Test ๐ง | |
run: stack test | |
run: | |
needs: [lint, style, test] | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
year: [2024, 2023, 2021, 2020] | |
steps: | |
- name: Checkout source ๐ก | |
uses: actions/checkout@v4 | |
- name: Cache ~/.stack ๐ฆ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-global- | |
- name: Cache .stack-work ๐ฆ | |
uses: actions/cache@v4 | |
with: | |
path: .stack-work | |
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }} | |
restore-keys: | | |
${{ runner.os }}-stack-work- | |
- name: Install Stack ๐ก | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: 9.6.6 | |
enable-stack: true | |
stack-version: "latest" | |
- name: Run ๐ | |
run: stack run advent-of-code-${{ matrix.year }}-exe |