From 416a5ef3321d5b90798fa02b027280909d75b82a Mon Sep 17 00:00:00 2001 From: Matvey Aksenov Date: Wed, 6 May 2026 09:35:05 +0000 Subject: [PATCH] feature: ci update --- .ghci | 3 ++ .github/workflows/build.yml | 59 +++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 19 ------------ .gitignore | 5 +--- .travis.yml | 37 ----------------------- .vim.custom | 16 ---------- README.markdown | 1 - shell.nix | 2 +- stack-7.10.yaml | 4 --- stack-8.0.yaml | 4 --- stack-8.2.yaml | 4 --- stack.yaml | 2 +- stack.yaml.lock | 12 ++++++++ 13 files changed, 77 insertions(+), 91 deletions(-) create mode 100644 .ghci create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 .vim.custom delete mode 100644 stack-7.10.yaml delete mode 100644 stack-8.0.yaml delete mode 100644 stack-8.2.yaml create mode 100644 stack.yaml.lock diff --git a/.ghci b/.ghci new file mode 100644 index 0000000..209931a --- /dev/null +++ b/.ghci @@ -0,0 +1,3 @@ +:set -Wall +:set -isrc +:set -itest diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1e43061 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +name: build + +concurrency: + # separate concurrency groups for pull requests (.head_ref) and pushes (.ref) + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +on: + pull_request: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + resolver: + - lts-22.44 # 9.6.7 + - lts-23.28 # 9.8.4 + - lts-24.39 # 9.10.3 + include: + - resolver: nightly + allow-failure: true + continue-on-error: ${{ matrix.allow-failure || false }} + + steps: + - uses: actions/checkout@v4 + + - uses: haskell-actions/setup@cd0d9bdd65b20557f41bea4dbe43d0b5fbbfe553 # @v2 + with: + enable-stack: true + + # GHC installation and dependencies should ideally change infrequently, + # so we cache them separately from ./.stack-work + - uses: actions/cache@v4 + with: + path: | + ~/.stack + key: ${{ runner.os }}-stack-global-${{ matrix.resolver }}-${{ hashFiles('stack.yaml.lock', 'package.yaml') }} + restore-keys: | + ${{ runner.os }}-stack-global-${{ matrix.resolver }}- + + - uses: actions/cache@v4 + with: + path: | + .stack-work + key: ${{ runner.os }}-stack-work-${{ matrix.resolver }}-${{ hashFiles('stack.yaml.lock', 'package.yaml', 'src/**/*.hs', 'test/**/*.hs', 'driver/**/*.hs') }} + restore-keys: | + ${{ runner.os }}-stack-work-${{ matrix.resolver }}- + + - run: stack build --resolver ${{ matrix.resolver }} --test --only-dependencies --no-terminal + + - run: stack build --resolver ${{ matrix.resolver }} --test --no-run-tests --no-terminal + + - run: stack test --resolver ${{ matrix.resolver }} --no-terminal diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index cbd9754..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: ci -on: - workflow_dispatch: - pull_request: - push: - branches: [master] - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: haskell/actions/setup@v2 - with: - ghc-version: '8.10' - enable-stack: true - stack-version: 'latest' - - run: stack test diff --git a/.gitignore b/.gitignore index 2924753..2349518 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -dist/ .stack-work/ -stack.yaml.lock -codex.tags -.gitignore +.ghci_history diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9f5aa00..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -sudo: false -language: generic - -addons: - apt: - packages: - - libgmp-dev - -env: - matrix: - - GHCVER=7.10 STACK_YAML=stack-7.10.yaml - - GHCVER=8.0 STACK_YAML=stack-8.0.yaml - - GHCVER=8.2 STACK_YAML=stack-8.2.yaml - - GHCVER=8.4 STACK_YAML=stack.yaml - -install: - # stack - - mkdir -p ~/.local/bin - - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v1.7.1/stack-1.7.1-linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - - export PATH=~/.local/bin:$PATH - - stack --no-terminal --version - -script: - - stack setup --no-terminal - - stack update --no-terminal - - stack build -j2 --fast --no-terminal - - travis_wait 45 sleep 1800 & - - stack test --fast --no-terminal - -cache: - timeout: 2000 - directories: - - $HOME/.cabal - - $HOME/.ghc - - $HOME/.stack - - .stack-work/ - apt: true diff --git a/.vim.custom b/.vim.custom deleted file mode 100644 index 29ae4e5..0000000 --- a/.vim.custom +++ /dev/null @@ -1,16 +0,0 @@ -function s:hdevtools_options(rgs) - return join(map(a:rgs, "'-g ' . v:val")) -endfunction - -let g:syntastic_haskell_hdevtools_args = s:hdevtools_options - \ ( - \ [ '-isrc' - \ , '-itest' - \ , '-O0' - \ , '-fdefer-type-errors' - \ , '-Wall' - \ , '-DTEST' - \ , '-optP-include' - \ , '-optPdist/build/autogen/cabal_macros.h' - \ ] - \ ) diff --git a/README.markdown b/README.markdown index 236e156..340255c 100644 --- a/README.markdown +++ b/README.markdown @@ -1,6 +1,5 @@ envparse ======== -[![Build status](https://github.com/supki/envparse/actions/workflows/ci.yml/badge.svg)](https://github.com/supki/envparse/actions/workflows/ci.yml) [optparse-applicative][0], but for environment variables diff --git a/shell.nix b/shell.nix index 93126fd..7ce0ff2 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,5 @@ { pkgs ? import {} -, ghc ? pkgs.haskell.compiler.ghc948 +, ghc ? pkgs.haskell.compiler.ghc984 }: pkgs.mkShell rec { diff --git a/stack-7.10.yaml b/stack-7.10.yaml deleted file mode 100644 index be2f3b1..0000000 --- a/stack-7.10.yaml +++ /dev/null @@ -1,4 +0,0 @@ -resolver: lts-6.35 -packages: - - '.' -allow-newer: true diff --git a/stack-8.0.yaml b/stack-8.0.yaml deleted file mode 100644 index 3d967c9..0000000 --- a/stack-8.0.yaml +++ /dev/null @@ -1,4 +0,0 @@ -resolver: lts-9.21 -packages: - - '.' -allow-newer: true diff --git a/stack-8.2.yaml b/stack-8.2.yaml deleted file mode 100644 index dacc90c..0000000 --- a/stack-8.2.yaml +++ /dev/null @@ -1,4 +0,0 @@ -resolver: lts-11.19 -packages: - - '.' -allow-newer: true diff --git a/stack.yaml b/stack.yaml index 77ab732..7b4fd50 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-21.25 +resolver: lts-23.28 packages: - '.' allow-newer: true diff --git a/stack.yaml.lock b/stack.yaml.lock new file mode 100644 index 0000000..a5db08c --- /dev/null +++ b/stack.yaml.lock @@ -0,0 +1,12 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/topics/lock_files + +packages: [] +snapshots: +- completed: + sha256: 7e724f347d5969cb5e8dde9f9aae30996e3231c29d1dafd45f21f1700d4c4fcb + size: 684460 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/28.yaml + original: lts-23.28