Skip to content
Merged
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
41 changes: 16 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,26 @@ jobs:
run: cabal update

- name: Build
run: cabal build all

- name: Tests
run: cabal test all

- name: Collect executable
if: runner.os != 'Windows'
shell: bash
run: |
mkdir -p artifacts
exe="$(find dist-newstyle \
-type f \
-path "*/x/openleetcode/build/openleetcode/openleetcode" \
| head -n 1)"
cabal install exe:openleetcode \
--installdir=artifacts \
--install-method=copy \
--overwrite-policy=always \
--enable-executable-stripping

cp "$exe" "artifacts/${{ matrix.artifact }}"
- name: Finalize artifact
if: runner.os != 'Windows'
run: mv artifacts/openleetcode "artifacts/${{ matrix.artifact }}"

- name: Collect executable
- name: Finalize artifact
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path artifacts
$exe = Get-ChildItem -Path dist-newstyle -Recurse -Filter "openleetcode.exe" |
Where-Object {
$_.FullName -like "*\x\openleetcode\build\openleetcode\openleetcode.exe"
} |
Select-Object -First 1
shell: bash
run: mv artifacts/openleetcode.exe "artifacts/${{ matrix.artifact }}.exe"

Copy-Item $exe.FullName "artifacts/${{ matrix.artifact }}.exe"
- name: Tests
run: cabal test all

- name: Smoke test
if: runner.os != 'Windows'
Expand All @@ -82,9 +74,8 @@ jobs:

- name: Smoke test
if: runner.os == 'Windows'
shell: pwsh
run: |
.\artifacts\${{ matrix.artifact }}.exe --version
shell: bash
run: ./artifacts/${{ matrix.artifact }}.exe --version

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
Loading