Skip to content

Commit

Permalink
Add release job
Browse files Browse the repository at this point in the history
  • Loading branch information
tbidne committed Mar 18, 2024
1 parent 60ee0a9 commit 805decb
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/scripts/rename_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

shrun_vers="0.9"

. /etc/lsb-release
ubuntu_vers=$(echo $DISTRIB_RELEASE)

arch=$(uname -m)

chmod a+x bin/shrun-ubuntu-latest
mv bin/shrun-ubuntu-latest "bin/shrun_$shrun_vers-$arch-linux-ubuntu_$ubuntu_vers"
11 changes: 11 additions & 0 deletions .github/scripts/rename_osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

shrun_vers="0.9"

# strip tab and/or spaces from output
apple_vers=$(sw_vers | grep ProductVersion | cut -d':' -f2 | tr -d ' \t')

arch=$(uname -m)

chmod a+x bin/shrun-macos-latest
mv bin/shrun-macos-latest "bin/shrun_$shrun_vers-$arch-apple_$apple_vers-darwin"
38 changes: 37 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
push:
branches:
- main
- release

pull_request:
branches:
- main
- release

workflow_dispatch:

Expand Down Expand Up @@ -82,7 +84,7 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable

- name: Compile & Test
run: nix build
run: nix build -L
lint:
runs-on: "ubuntu-latest"
steps:
Expand All @@ -101,3 +103,37 @@ jobs:
- name: HLint
run: nix run .#lint
release:
needs: [cabal, nix, lint]
if: github.ref == 'refs/heads/release'
strategy:
fail-fast: false
matrix:
platform:
- os: "macos-latest"
renamer: rename_osx.sh
- os: "ubuntu-latest"
renamer: rename_linux.sh
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
with:
ghc-version: "9.6.3"

- name: Configure
# TODO: It would be nice if we could figure out static binaries.
# This doesn't appear to work, according to ldd.
run: cabal configure --enable-executable-static --enable-executable-stripping --ghc-options -Werror

- name: Install binary
run: |
cabal install --installdir=bin --install-method=copy --program-suffix=-${{ matrix.platform.os }}
.github/scripts/${{ matrix.platform.renamer }}
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: bin
5 changes: 3 additions & 2 deletions test/functional/Functional/Buffering.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ logsNoBuffer =
withTimerPrefix "3 seconds",
withCommandPrefix cmdPrefix "3.5",
withTimerPrefix "4 seconds",
withSuccessPrefix cmdPrefix <> "4 seconds",
withFinishedPrefix "4 seconds"
-- No seconds here because it is flaky (e.g. can be either 4/5 seconds)
withSuccessPrefix cmdPrefix,
withFinishedPrefix ""
]

assertLogsEq :: List Text -> List Text -> IO ()
Expand Down

0 comments on commit 805decb

Please sign in to comment.