Skip to content

Commit

Permalink
Merge pull request #251 from well-typed/edsko/cleanup-tutorials
Browse files Browse the repository at this point in the history
Cleanup the tutorials
  • Loading branch information
edsko authored Oct 25, 2024
2 parents ef35515 + fddd0ec commit b411b88
Show file tree
Hide file tree
Showing 22 changed files with 101 additions and 1,992 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,39 +177,39 @@ jobs:
echo "PKGDIR_grpc_spec=${PKGDIR_grpc_spec}" >> "$GITHUB_ENV"
PKGDIR_grapesy="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/grapesy-[0-9.]*')"
echo "PKGDIR_grapesy=${PKGDIR_grapesy}" >> "$GITHUB_ENV"
PKGDIR_quickstart="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/quickstart-[0-9.]*')"
echo "PKGDIR_quickstart=${PKGDIR_quickstart}" >> "$GITHUB_ENV"
PKGDIR_basics="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/basics-[0-9.]*')"
echo "PKGDIR_basics=${PKGDIR_basics}" >> "$GITHUB_ENV"
PKGDIR_lowlevel="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/lowlevel-[0-9.]*')"
echo "PKGDIR_lowlevel=${PKGDIR_lowlevel}" >> "$GITHUB_ENV"
PKGDIR_metadata="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/metadata-[0-9.]*')"
echo "PKGDIR_metadata=${PKGDIR_metadata}" >> "$GITHUB_ENV"
PKGDIR_monadstack="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/monadstack-[0-9.]*')"
echo "PKGDIR_monadstack=${PKGDIR_monadstack}" >> "$GITHUB_ENV"
PKGDIR_quickstart_tutorial="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/quickstart-tutorial-[0-9.]*')"
echo "PKGDIR_quickstart_tutorial=${PKGDIR_quickstart_tutorial}" >> "$GITHUB_ENV"
PKGDIR_basics_tutorial="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/basics-tutorial-[0-9.]*')"
echo "PKGDIR_basics_tutorial=${PKGDIR_basics_tutorial}" >> "$GITHUB_ENV"
PKGDIR_lowlevel_tutorial="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/lowlevel-tutorial-[0-9.]*')"
echo "PKGDIR_lowlevel_tutorial=${PKGDIR_lowlevel_tutorial}" >> "$GITHUB_ENV"
PKGDIR_metadata_tutorial="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/metadata-tutorial-[0-9.]*')"
echo "PKGDIR_metadata_tutorial=${PKGDIR_metadata_tutorial}" >> "$GITHUB_ENV"
PKGDIR_monadstack_tutorial="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/monadstack-tutorial-[0-9.]*')"
echo "PKGDIR_monadstack_tutorial=${PKGDIR_monadstack_tutorial}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_grpc_spec}" >> cabal.project
echo "packages: ${PKGDIR_grapesy}" >> cabal.project
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_quickstart}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_basics}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_lowlevel}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_metadata}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_monadstack}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_quickstart_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_basics_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_lowlevel_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_metadata_tutorial}" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_monadstack_tutorial}" >> cabal.project ; fi
echo "package grpc-spec" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package grapesy" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package quickstart" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package quickstart-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package basics" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package basics-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package lowlevel" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package lowlevel-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package metadata" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package metadata-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package monadstack" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package monadstack-tutorial" >> cabal.project ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
allow-newer: proto-lens:base
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
package monadstack
ghc-options: -Werror
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(basics|grapesy|grpc-spec|lowlevel|metadata|monadstack|quickstart)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(basics-tutorial|grapesy|grpc-spec|lowlevel-tutorial|metadata-tutorial|monadstack-tutorial|quickstart-tutorial)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down Expand Up @@ -273,15 +273,15 @@ jobs:
${CABAL} -vnormal check
cd ${PKGDIR_grapesy} || false
${CABAL} -vnormal check
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_quickstart} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_quickstart_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_basics} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_basics_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_lowlevel} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_lowlevel_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_metadata} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_metadata_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_monadstack} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_monadstack_tutorial} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
- name: haddock
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cabal-version: 3.0
name: basics
name: basics-tutorial
synopsis: gRPC basics tutorial for grapesy
version: 0.1.0
license: BSD-3-Clause
Expand Down Expand Up @@ -60,20 +60,18 @@ library
Proto.API.RouteGuide
other-modules:
Proto.RouteGuide
Paths_basics
Paths_basics_tutorial
autogen-modules:
Proto.RouteGuide
Paths_basics
Paths_basics_tutorial

executable route_guide_server
import: lang
main-is: Server.hs
hs-source-dirs: app
ghc-options: -main-is Server
build-depends: basics-tutorial

build-depends:
-- internal
, basics
build-depends:
-- inherited
, grapesy
Expand All @@ -84,10 +82,8 @@ executable route_guide_client
main-is: Client.hs
hs-source-dirs: app
ghc-options: -main-is Client
build-depends: basics-tutorial

build-depends:
-- internal
, basics
build-depends:
-- inherited
, grapesy
Expand Down
2 changes: 1 addition & 1 deletion tutorials/basics/src/RouteGuide.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Network.GRPC.Common.Protobuf

import Proto.RouteGuide

import Paths_basics
import Paths_basics_tutorial

{-------------------------------------------------------------------------------
Querying the database
Expand Down
3 changes: 0 additions & 3 deletions tutorials/lowlevel/Setup.hs

This file was deleted.

4 changes: 0 additions & 4 deletions tutorials/lowlevel/data/README.md

This file was deleted.

Loading

0 comments on commit b411b88

Please sign in to comment.