-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06af52b
commit 865cfc1
Showing
3 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Cache' | ||
description: 'Cache for CI' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/cache@v3 | ||
name: Cache ~/.stack | ||
with: | ||
path: ~/.stack | ||
key: stack-global | ||
restore-keys: | | ||
stack-global | ||
- uses: actions/cache@v3 | ||
name: Cache .stack-work | ||
with: | ||
path: ./.stack-work | ||
key: stack-work | ||
restore-keys: | | ||
stack-work | ||
- name: Install Stack | ||
shell: bash | ||
run: curl -sSL https://get.haskellstack.org/ | sh -s - -f |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: "CI for haskell-ffprobe" | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
release: | ||
types: [ published ] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
Changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
sources: ${{ steps.filter.outputs.sources }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
sources: | ||
- 'src/**' | ||
- 'test/**.hs' | ||
- '.github/workflows/CI.yml' | ||
Build: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.sources == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Setup GHC | ||
uses: ./.github/actions/cache | ||
- name: Build | ||
run: stack build | ||
Format: | ||
if: ${{ needs.changes.outputs.sources == 'true' }} | ||
runs-on: ubuntu-latest | ||
needs: [ Build ] | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Setup GHC | ||
uses: ./.github/actions/cache | ||
- uses: haskell-actions/run-fourmolu@v9 | ||
with: | ||
version: "0.14.0.0" | ||
pattern: | | ||
./src/**/*.hs | ||
./test/**/*.hs | ||
follow-symbolic-links: false | ||
Lint: | ||
if: ${{ needs.changes.outputs.sources == 'true' }} | ||
runs-on: ubuntu-latest | ||
needs: [ Build ] | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Setup GHC | ||
uses: ./.github/actions/cache | ||
- name: 'Set up HLint' | ||
uses: rwe/actions-hlint-setup@v1 | ||
with: | ||
version: '3.5' | ||
- name: 'Run HLint' | ||
uses: rwe/actions-hlint-run@v2 | ||
with: | ||
path: '["./src/", "./test/"]' | ||
fail-on: warning | ||
Tests: | ||
runs-on: ubuntu-latest | ||
needs: [ Build ] | ||
if: ${{ needs.changes.outputs.sources == 'true' }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Setup GHC | ||
uses: ./.github/actions/cache | ||
- name: Run unit tests | ||
run: stack test |
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