Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.7.2 #11

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
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
33 changes: 24 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,28 @@ jobs:
name: ${{ matrix.os }} - GHC ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest]
# Check the haddock step below which is limited to a single GHC version!
ghc:
- 9.8
- 9.6
- 9.4
- 9.2
fail-fast: false
- '9.10'
- '9.8'
- '9.6'
- '9.4'
- '9.2'
- '9.0'
- '8.10'
- '8.8'
- '8.6'
- '8.4'
- '8.2'
- '8.0'
include:
- os: macos-latest
ghc: '9.10'
- os: windows-latest
ghc: '9.10'

steps:
- uses: actions/checkout@v4
Expand All @@ -34,7 +48,7 @@ jobs:
cabal build all --dry-run

- name: Restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cache
with:
path: ${{ steps.setup.outputs.cabal-store }}
Expand All @@ -48,12 +62,13 @@ jobs:
- run: cabal build all
- run: cabal test all
- run: cabal haddock
if: matrix.ghc == '9.8'
- run: cabal check
- run: cabal sdist

- name: Save cache
uses: actions/cache/save@v3
if: always()
uses: actions/cache/save@v4
if: always() && steps.cache.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache.outputs.cache-primary-key }}
path: ${{ steps.setup.outputs.cabal-store }}
163 changes: 163 additions & 0 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: stack
on:
push:
branches:
- main
pull_request:
branches:
- main

defaults:
run:
shell: bash

jobs:
stack:
name: Stack ${{ matrix.ghc }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:

- os: macos-latest
ghc: 9.8.2
resolver: nightly-2024-06-22
- os: macos-latest
ghc: 9.2.8
resolver: lts-20.26
# GHC < 9.2 not supported on macos-14 ARM runner
# https://github.com/haskell-actions/setup/issues/77

- os: windows-latest
ghc: 9.8.2
resolver: nightly-2024-06-22
- os: windows-latest
ghc: 8.4.4
resolver: lts-12.26

- os: ubuntu-latest
ghc: 9.8.2
resolver: nightly-2024-06-22
- os: ubuntu-latest
ghc: 9.6.5
resolver: lts-22.26
- os: ubuntu-latest
ghc: 9.4.8
resolver: lts-21.25
- os: ubuntu-latest
ghc: 9.2.8
resolver: lts-20.26
- os: ubuntu-latest
ghc: 9.0.2
resolver: lts-19.33
- os: ubuntu-latest
ghc: 8.10.7
resolver: lts-18.28
- os: ubuntu-latest
ghc: 8.8.4
resolver: lts-16.31
- os: ubuntu-latest
ghc: 8.6.5
resolver: lts-14.27
- os: ubuntu-latest
ghc: 8.4.4
resolver: lts-12.26

# Tests need directory-1.3.1.0 which entered LTS for GHC 8.4.
# - os: ubuntu-latest
# ghc: 8.2.2
# resolver: lts-11.22
# - os: ubuntu-latest
# ghc: 8.0.2
# resolver: lts-9.21

env:
stack: 'stack --system-ghc --no-install-ghc'

steps:

- uses: actions/checkout@v4

- name: Install GHC and stack with haskell-actions/setup
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
cabal-update: false

- name: Create stack.yaml
run: |
cat > stack.yaml <<EOF
resolver: ${{ matrix.resolver }}
compiler: ghc-${{ matrix.ghc }}
packages: [.]
EOF

# According to https://github.com/commercialhaskell/stack/issues/5754#issuecomment-1696156869
# not all of ~/.stack should be cached,
# only the index (pantry) and the dependencies (sqlite3+snapshots).

## Pantry
########################################################################

- name: Restore cached stack pantry
uses: actions/cache/restore@v4
id: cache-pantry
with:
path: ${{ steps.setup.outputs.stack-root }}/pantry
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-pantry-resolver-${{ matrix.resolver }}
# No fall-back keys here!

- name: Stack update
if: steps.cache-pantry.outputs.cache-hit != 'true'
run: ${{ env.stack }} update

- name: Cache stack pantry
if: steps.cache-pantry.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ steps.setup.outputs.stack-root }}/pantry
key: ${{ steps.cache-pantry.outputs.cache-primary-key }}

## Dependencies
########################################################################

- name: Stack build plan
run: ${{ env.stack }} test --dry-run > '.build-plan.txt'

- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache-deps
with:
path: |
${{ steps.setup.outputs.stack-root }}/stack.sqlite3
${{ steps.setup.outputs.stack-root }}/snapshots
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-resolver-${{ matrix.resolver }}-plan-${{ hashfiles('.build-plan.txt') }}
restore-keys: |
${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-resolver-${{ matrix.resolver }}-
${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-

- name: Build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: ${{ env.stack }} test --dependencies-only

- name: Cache dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
${{ steps.setup.outputs.stack-root }}/stack.sqlite3
${{ steps.setup.outputs.stack-root }}/snapshots
key: ${{ steps.cache-deps.outputs.cache-primary-key }}

## Build and test STMonadTrans
########################################################################

- name: Build w/ tests
run: ${{ env.stack }} test --no-run-tests

- name: Run tests
run: ${{ env.stack }} test
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
## Version 0.7.2 (2024-06-25)

- Remove flag `old-time` and drop support for `old-time`.
- Remove support for GHC 7.
- Tested with GHC 8.0 - 9.10.

## Version 0.7.1 (2023-12-06) Santa Clause edition

- Add `System.PosixCompat.Process` module, exporting `getProcessID`
- Add `System.PosixCompat.Process` module, exporting `getProcessID`.

## Version 0.7 (2023-03-15)

- Remove `System.PosixCompat.User` module
- Remove `System.PosixCompat.User` module.

## Version 0.6 (2022-05-22)

- Better support for symbolic links
- Better support for symbolic links.
12 changes: 0 additions & 12 deletions src/System/PosixCompat/Internal/Time.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ module System.PosixCompat.Internal.Time (
) where

import System.Posix.Types (EpochTime)

#ifdef OLD_TIME

import System.Time (ClockTime(TOD), getClockTime)

clockTimeToEpochTime :: ClockTime -> EpochTime
clockTimeToEpochTime (TOD s _) = fromInteger s

#else

import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime)

type ClockTime = POSIXTime
Expand All @@ -29,5 +19,3 @@ getClockTime = getPOSIXTime

clockTimeToEpochTime :: ClockTime -> EpochTime
clockTimeToEpochTime = fromInteger . floor

#endif
Loading