Skip to content

Commit 53fae37

Browse files
committed
GitHub Action generated with https://github.com/haskell-CI/haskell-ci
1 parent f15864a commit 53fae37

File tree

9 files changed

+271
-1
lines changed

9 files changed

+271
-1
lines changed

.github/workflows/haskell-ci.yml

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'cabal.project'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
8+
#
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
10+
#
11+
# version: 0.14.3
12+
#
13+
# REGENDATA ("0.14.3",["github","cabal.project"])
14+
#
15+
name: Haskell-CI
16+
on:
17+
- push
18+
- pull_request
19+
jobs:
20+
linux:
21+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22+
runs-on: ubuntu-18.04
23+
timeout-minutes:
24+
60
25+
container:
26+
image: buildpack-deps:bionic
27+
continue-on-error: ${{ matrix.allow-failure }}
28+
strategy:
29+
matrix:
30+
include:
31+
- compiler: ghc-9.0.2
32+
compilerKind: ghc
33+
compilerVersion: 9.0.2
34+
setup-method: ghcup
35+
allow-failure: false
36+
- compiler: ghc-8.10.7
37+
compilerKind: ghc
38+
compilerVersion: 8.10.7
39+
setup-method: ghcup
40+
allow-failure: false
41+
fail-fast: false
42+
steps:
43+
- name: apt
44+
run: |
45+
apt-get update
46+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
47+
mkdir -p "$HOME/.ghcup/bin"
48+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup"
49+
chmod a+x "$HOME/.ghcup/bin/ghcup"
50+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
51+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
52+
env:
53+
HCKIND: ${{ matrix.compilerKind }}
54+
HCNAME: ${{ matrix.compiler }}
55+
HCVER: ${{ matrix.compilerVersion }}
56+
- name: Set PATH and environment variables
57+
run: |
58+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
59+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
60+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
61+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
62+
HCDIR=/opt/$HCKIND/$HCVER
63+
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
64+
echo "HC=$HC" >> "$GITHUB_ENV"
65+
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
66+
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
67+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
68+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
69+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
70+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
71+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
72+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
73+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
74+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
75+
env:
76+
HCKIND: ${{ matrix.compilerKind }}
77+
HCNAME: ${{ matrix.compiler }}
78+
HCVER: ${{ matrix.compilerVersion }}
79+
- name: env
80+
run: |
81+
env
82+
- name: write cabal config
83+
run: |
84+
mkdir -p $CABAL_DIR
85+
cat >> $CABAL_CONFIG <<EOF
86+
remote-build-reporting: anonymous
87+
write-ghc-environment-files: never
88+
remote-repo-cache: $CABAL_DIR/packages
89+
logs-dir: $CABAL_DIR/logs
90+
world-file: $CABAL_DIR/world
91+
extra-prog-path: $CABAL_DIR/bin
92+
symlink-bindir: $CABAL_DIR/bin
93+
installdir: $CABAL_DIR/bin
94+
build-summary: $CABAL_DIR/logs/build.log
95+
store-dir: $CABAL_DIR/store
96+
install-dirs user
97+
prefix: $CABAL_DIR
98+
repository hackage.haskell.org
99+
url: http://hackage.haskell.org/
100+
EOF
101+
cat >> $CABAL_CONFIG <<EOF
102+
program-default-options
103+
ghc-options: $GHCJOBS +RTS -M3G -RTS
104+
EOF
105+
cat $CABAL_CONFIG
106+
- name: versions
107+
run: |
108+
$HC --version || true
109+
$HC --print-project-git-commit-id || true
110+
$CABAL --version || true
111+
- name: update cabal index
112+
run: |
113+
$CABAL v2-update -v
114+
- name: install cabal-plan
115+
run: |
116+
mkdir -p $HOME/.cabal/bin
117+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
118+
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
119+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
120+
rm -f cabal-plan.xz
121+
chmod a+x $HOME/.cabal/bin/cabal-plan
122+
cabal-plan --version
123+
- name: checkout
124+
uses: actions/checkout@v2
125+
with:
126+
path: source
127+
- name: initial cabal.project for sdist
128+
run: |
129+
touch cabal.project
130+
echo "packages: $GITHUB_WORKSPACE/source/kubernetes" >> cabal.project
131+
echo "packages: $GITHUB_WORKSPACE/source/kubernetes-client" >> cabal.project
132+
echo "packages: $GITHUB_WORKSPACE/source/examples" >> cabal.project
133+
cat cabal.project
134+
- name: sdist
135+
run: |
136+
mkdir -p sdist
137+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
138+
- name: unpack
139+
run: |
140+
mkdir -p unpacked
141+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
142+
- name: generate cabal.project
143+
run: |
144+
PKGDIR_kubernetes_client_core="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/kubernetes-client-core-[0-9.]*')"
145+
echo "PKGDIR_kubernetes_client_core=${PKGDIR_kubernetes_client_core}" >> "$GITHUB_ENV"
146+
PKGDIR_kubernetes_client="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/kubernetes-client-[0-9.]*')"
147+
echo "PKGDIR_kubernetes_client=${PKGDIR_kubernetes_client}" >> "$GITHUB_ENV"
148+
PKGDIR_kubernetes_examples="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/kubernetes-examples-[0-9.]*')"
149+
echo "PKGDIR_kubernetes_examples=${PKGDIR_kubernetes_examples}" >> "$GITHUB_ENV"
150+
rm -f cabal.project cabal.project.local
151+
touch cabal.project
152+
touch cabal.project.local
153+
echo "packages: ${PKGDIR_kubernetes_client_core}" >> cabal.project
154+
echo "packages: ${PKGDIR_kubernetes_client}" >> cabal.project
155+
echo "packages: ${PKGDIR_kubernetes_examples}" >> cabal.project
156+
echo "package kubernetes-client-core" >> cabal.project
157+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
158+
echo "package kubernetes-client" >> cabal.project
159+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
160+
echo "package kubernetes-examples" >> cabal.project
161+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
162+
cat >> cabal.project <<EOF
163+
EOF
164+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(kubernetes-client|kubernetes-client-core|kubernetes-examples)$/; }' >> cabal.project.local
165+
cat cabal.project
166+
cat cabal.project.local
167+
- name: dump install plan
168+
run: |
169+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
170+
cabal-plan
171+
- name: cache
172+
uses: actions/cache@v2
173+
with:
174+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
175+
path: ~/.cabal/store
176+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
177+
- name: install dependencies
178+
run: |
179+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
180+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
181+
- name: build w/o tests
182+
run: |
183+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
184+
- name: build
185+
run: |
186+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
187+
- name: tests
188+
run: |
189+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
190+
- name: cabal check
191+
run: |
192+
cd ${PKGDIR_kubernetes_client_core} || false
193+
${CABAL} -vnormal check
194+
cd ${PKGDIR_kubernetes_client} || false
195+
${CABAL} -vnormal check
196+
cd ${PKGDIR_kubernetes_examples} || false
197+
${CABAL} -vnormal check
198+
- name: haddock
199+
run: |
200+
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
201+
- name: unconstrained build
202+
run: |
203+
rm -f cabal.project.local
204+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Kubernetes Haskell Client
22

3+
[![Haskell-CI](https://github.com/kubernetes-client/haskell/actions/workflows/haskell-ci.yml/badge.svg)](https://github.com/kubernetes-client/haskell/actions/workflows/haskell-ci.yml)
34
[![Build Status](https://travis-ci.org/kubernetes-client/haskell.svg?branch=master)](https://travis-ci.org/kubernetes-client/haskell)
45

56
Haskell client for the [kubernetes](http://kubernetes.io/) API.

cabal.project

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packages:
2+
kubernetes
3+
kubernetes-client
4+
examples

examples/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
dist
22
dist-newstyle
3-
*.cabal
43
.stack-work

examples/kubernetes-examples.cabal

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
cabal-version: 1.12
2+
3+
-- This file has been generated from package.yaml by hpack version 0.34.4.
4+
--
5+
-- see: https://github.com/sol/hpack
6+
7+
name: kubernetes-examples
8+
version: 0.1.0.1
9+
synopsis: Kubernetes examples with Haskell
10+
description: Examples to interact with Kubernetes using kubernetes-client and kubernetes-client-core
11+
category: Examples, Kubernetes
12+
maintainer: Shimin Guo <smguo2001@gmail.com>,
13+
Akshay Mankar <itsakshaymankar@gmail.com>
14+
license: Apache-2.0
15+
license-file: LICENSE
16+
build-type: Simple
17+
tested-with:
18+
GHC==9.0.2, GHC==8.10.7
19+
20+
executable in-cluster
21+
main-is: Main.hs
22+
other-modules:
23+
Paths_kubernetes_examples
24+
hs-source-dirs:
25+
in-cluster
26+
ghc-options: -Wall
27+
build-depends:
28+
base
29+
, containers
30+
, http-client
31+
, http-types
32+
, kubernetes-client
33+
, kubernetes-client-core
34+
, safe-exceptions
35+
, stm
36+
, text
37+
default-language: Haskell2010
38+
39+
executable simple
40+
main-is: Main.hs
41+
other-modules:
42+
Paths_kubernetes_examples
43+
hs-source-dirs:
44+
simple
45+
ghc-options: -Wall
46+
build-depends:
47+
base
48+
, containers
49+
, http-client
50+
, http-types
51+
, kubernetes-client
52+
, kubernetes-client-core
53+
, safe-exceptions
54+
, stm
55+
, text
56+
default-language: Haskell2010

examples/package.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ dependencies:
3131
- safe-exceptions
3232
- stm
3333
- text
34+
tested-with: GHC==9.0.2, GHC==8.10.7

kubernetes-client/kubernetes-client.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ maintainer: Shimin Guo <smguo2001@gmail.com>,
1616
license: Apache-2.0
1717
license-file: LICENSE
1818
build-type: Simple
19+
tested-with:
20+
GHC==9.0.2, GHC==8.10.7
1921
extra-source-files:
2022
test/testdata/certs/certificate.pem
2123
test/testdata/certs/private-key.pem

kubernetes-client/package.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ library:
1515
source-dirs: src
1616
ghc-options:
1717
- -Wall
18+
tested-with: GHC==9.0.2, GHC==8.10.7
1819
tests:
1920
spec:
2021
main: Spec.hs

kubernetes/kubernetes-client-core.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ license-file: LICENSE
2121
build-type: Simple
2222
cabal-version: >= 1.10
2323

24+
tested-with: GHC==9.0.2, GHC==8.10.7
25+
2426
extra-source-files:
2527
README.md
2628
openapi.yaml

0 commit comments

Comments
 (0)