-
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.
Workflow for running the test script (#75)
- Loading branch information
1 parent
daa2218
commit 2e4ae53
Showing
3 changed files
with
105 additions
and
2 deletions.
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,100 @@ | ||
--- | ||
name: Compile and Lint Flex-Tasks | ||
|
||
env: | ||
tasks: tasks | ||
config: pkgdb-config | ||
script: tasks | ||
|
||
on: | ||
push: | ||
branches: ['*'] | ||
paths: | ||
- "tasks/*.txt" | ||
- "pkgdb-config/*.yaml" | ||
- ".github/workflows/test-flex.yml" | ||
- "tasks/test.sh" | ||
- "tasks/runGhci.expect" | ||
- "tasks/.hlint.yaml" | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
test_flex: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: zsh hlint expect colorized-logs | ||
version: 1.0 | ||
|
||
- name: Cache DB | ||
id: restore-cache-db | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.tasks }}/root | ||
key: ${{ hashFiles(format('{0}/stack.yaml', env.config)) }}-${{ hashFiles(format('{0}/package.yaml', env.config)) }} | ||
restore-keys: | | ||
${{ hashFiles(format('{0}/stack.yaml', env.config)) }} | ||
- uses: actions/checkout@v4 | ||
if: steps.restore-cache-db.outputs.cache-hit != 'true' | ||
with: | ||
repository: fmidue/haskell-template-setup | ||
path: haskell-template-setup | ||
|
||
- name: Setup DB | ||
if: steps.restore-cache-db.outputs.cache-hit != 'true' | ||
run: | | ||
set -ex | ||
sudo mv -f ./${{ env.config }}/stack.yaml ./haskell-template-setup | ||
sudo mv -f ./${{ env.config }}/package.yaml ./haskell-template-setup | ||
cd haskell-template-setup | ||
sed -i "s@/autotool/default@$(realpath $PWD/../${{ env.tasks }}/root)@" env | ||
./create.sh | ||
sudo mv root ../${{ env.tasks }} | ||
set +ex | ||
- name: Determine GHC-Version | ||
id: ghc-version | ||
run: | | ||
set -ex | ||
cd ${{ env.tasks }} | ||
ghc_file=$(find root/pkgdb -name "ghci*" -print -quit) | ||
temp="${ghc_file##*/ghci-}" | ||
ghc_version="${temp%-*.conf*}" | ||
echo "version=$ghc_version" >> $GITHUB_OUTPUT | ||
set +ex | ||
- name: Install GHC | ||
uses: haskell-actions/setup@v2 | ||
with: | ||
ghc-version: ${{steps.ghc-version.outputs.version}} | ||
|
||
- name: Run Test Script | ||
run: | | ||
set -ex | ||
cd ${{ env.tasks }} | ||
find . -name '*.txt' -exec ../${{ env.script }}/test.sh {} root \; | ||
set +ex | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
id: upload-artifact | ||
with: | ||
name: reports | ||
path: ${{ env.tasks }}/*/*.html | ||
if-no-files-found: error | ||
overwrite: true | ||
|
||
- name: Link Comment | ||
uses: peter-evans/commit-comment@v3 | ||
with: | ||
body: | | ||
Changes in task folder or test-flex workflow. You may review the test results: | ||
[Download Reports](${{ steps.upload-artifact.outputs.artifact-url }}) |
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,2 @@ | ||
--- | ||
ignore: {name: Redundant pure} |
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
2e4ae53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in task folder or test-flex workflow. You may review the test results:
Download Reports