Skip to content

Commit

Permalink
Merge branch 'main' into documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed May 16, 2024
2 parents 16f91d6 + 0902441 commit b113f82
Show file tree
Hide file tree
Showing 107 changed files with 3,671 additions and 3,195 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ampersandtarski/ampersand-devcontainer:latest
FROM ampersandtarski/ampersand-devcontainer:ghc9-6-4_1

ENV DEBIAN_FRONTEND=dialog

Expand Down
39 changes: 22 additions & 17 deletions .devcontainer/DockerfileUpstream
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,26 @@ ENV USERNAME=${USERNAME} \
RUN \
apt-get update -y && \
apt-get install -y --no-install-recommends \
apt-transport-https \
autoconf \
automake \
build-essential \
curl \
libnuma-dev \
zlib1g-dev \
gcc \
git \
gnupg2 \
graphviz \
libbz2-dev \
libexpat1-dev \
libgmp-dev \
libgmp10 \
git \
wget \
libnuma-dev \
lsb-release \
openssh-server \
pkg-config \
software-properties-common \
gnupg2 \
apt-transport-https \
gcc \
autoconf \
automake \
build-essential \
wget \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN groupadd --gid $USER_GID $USERNAME && \
Expand All @@ -57,10 +62,10 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
# Add ghcup and cabal to the PATH
ENV PATH="${WDIR}/.cabal/bin:${WDIR}/.ghcup/bin:${PATH}:${WDIR}/.local/bin:${PATH}"

ARG GHC=8.10.7
ARG CABAL=3.6.2.0
ARG HLS=2.2.0.0
ARG STACK=2.11.1
ARG GHC=9.6.4
ARG CABAL=3.10.2.1
ARG HLS=2.7.0.0
ARG STACK=2.15.5

# install GHC and cabal

Expand All @@ -73,9 +78,9 @@ FROM base as tools

# Install global packages.
# Versions are pinned, since we don't want to accidentally break anything (by always installing latest).
RUN cabal install -v haskell-dap-0.0.15.0 && \
cabal install -v stylish-haskell-0.13.0.0 && \
cabal install -v ormolu-0.1.3.1
RUN cabal install -v haskell-dap-0.0.16.0 && \
cabal install -v stylish-haskell-0.14.5.0 && \
cabal install -v ormolu-0.7.2.0
# RUN cabal install -v ghci-dap-0.0.19.0
# RUN cabal install -v haskell-debug-adapter-0.0.37.0
# RUN cabal install -v hlint-3.2.7
Expand Down
6 changes: 4 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ NB: This action is currently done by Han, no need for other people to do so. It
Sometimes there are updates of the Haskell toolchain we use. For instance whenever a new version of the Haskell Language Server is made available, the `DockerfileUpstream` should be updated accordingly. Then, the new image should be built and published at dockerhub. To do so, go to the ampersand root directory and run the following commands:

```
docker build -f .devcontainer/DockerfileUpstream -t ampersandtarski/ampersand-devcontainer:latest .
docker push ampersandtarski/ampersand-devcontainer:latest
docker build -f .devcontainer/DockerfileUpstream -t ampersandtarski/ampersand-devcontainer:<tag> .
docker push ampersandtarski/ampersand-devcontainer:<tag>
```

where `<tag>` must be replaced with an appropriate new tagname reflecting the version of ghc.
28 changes: 16 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
{
"name": "DevContainer for Ampersand",
"name": "Ampersand 5 devcontainer",
// "remoteUser": "root",
"runArgs": [],
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
// "postCreateCommand": "sudo apt-get update && sudo apt-get install -y openssh-client",
"mounts": [
"type=bind,source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh/,target=/home/vscode/.ssh,readonly"
],
"postStartCommand": "stack build",
"customizations": {
"vscode": {
"extensions": [
"haskell.haskell",
"justusadam.language-haskell",
"phoityne.phoityne-vscode",
"ampersandtarski.language-ampersand",
// Because of bug (see https://github.com/Microsoft/vscode/issues/45997):
"bdsoftware.format-on-auto-save",
"eamodio.gitlens",
"editorconfig.editorconfig",
"eriksik2.vscode-ghci",
"jcanero.hoogle-vscode",
"github.vscode-pull-request-github",
"eamodio.gitlens",
"haskell.haskell",
"huizhou.githd",
"jcanero.hoogle-vscode",
"justusadam.language-haskell",
"me-dutour-mathieu.vscode-github-actions",
"redhat.vscode-yaml",
"ampersandtarski.language-ampersand",
"mhutchie.git-graph",
"editorconfig.editorconfig",
// Because of bug (see https://github.com/Microsoft/vscode/issues/45997):
"bdsoftware.format-on-auto-save"
"phoityne.phoityne-vscode",
"redhat.vscode-yaml",
"tintinweb.graphviz-interactive-preview"
],
"settings": {
"editor.formatonsave": true,
Expand Down
70 changes: 34 additions & 36 deletions .github/workflows/ci2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,59 +41,57 @@ jobs:
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
- name: Use cache when available 📦
uses: freckle/stack-cache-action@main
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
- name: Build and test 🏗 🧪
uses: freckle/stack-action@v4 # stack-action does all these steps: dependencies, build, test.
uses: freckle/stack-action@v5 # stack-action does all these steps: dependencies, build, test.
with:
stack-arguments: "--copy-bins --flag ampersand:buildAll"
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
upgrade-stack: false
cache-save-always: true

build-and-test-macOS:
name: Build and test on macOS 🏗 🧪
runs-on: macos-latest
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
- name: Use cache when available 📦
uses: freckle/stack-cache-action@main
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
# See issue https://github.com/freckle/stack-action/issues/80 for why we need to install stack and php as well
- run: curl -sSL https://get.haskellstack.org/ | sh
- run: brew install php
- name: Build and test 🏗 🧪
uses: freckle/stack-action@v4
uses: freckle/stack-action@v5
with:
stack-arguments: "--copy-bins --flag ampersand:buildAll"
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"

build-and-test-windows:
name: Build and test on Windows 🏗 🧪
runs-on: windows-latest
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
- name: Use cache (manually) 📦 # See https://github.com/freckle/stack-cache-action/issues/5
uses: actions/[email protected]
# TODO: Cache might be done better, see for inspiration: https://github.com/godu/advent-of-code-2020/blob/46796832f59d185457a8edf8de043a54a451d688/.github/workflows/ci.yml
with:
path: |
~/.ghc
~/.stack
~/.stack-work
key: ${{ runner.os }}-stack
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
- name: Setup PHP 🧰
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
extensions: mysqli
- name: Build and test 🏗 🧪
uses: freckle/stack-action@v4
with:
stack-arguments: "--copy-bins --flag ampersand:buildAll"
# build-and-test-windows:
# name: Build and test on Windows 🏗 🧪
# runs-on: windows-latest
# steps:
# - name: Checkout project contents 📡
# uses: actions/checkout@v3
# - uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
# id: expatLibraryZip # Remember to give an ID if you need the output filename
# name: Download the expat library
# with:
# url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_2/expat-win32bin-2.6.2.zip"
# target: public/
# - name: Set up Mariadb 🧰
# uses: shogo82148/actions-setup-mysql@v1
# with:
# mysql-version: "mariadb-10.6"
# - name: Setup PHP 🧰
# uses: shivammathur/setup-php@v2
# with:
# php-version: "8.0"
# extensions: mysqli
# - name: Build and test 🏗 🧪
# uses: freckle/stack-action@v5
# with:
# stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
4 changes: 1 addition & 3 deletions .github/workflows/codeQuality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ jobs:
steps:
- name: Checkout project contents 📡
uses: actions/[email protected]
- name: Use cache when available 📦
uses: freckle/stack-cache-action@main
- name: Build the project 🌿🌿🌿
uses: freckle/stack-action@v4
uses: freckle/stack-action@v5
with:
test: false

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ormolu-formatting-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ jobs:
# The checkout step is needed since the enforcer relies on local git commands
- uses: actions/checkout@v3

- uses: mrkkrp/ormolu-action@v2 # BEWARE: Do not upgrade unless we use ghc 9 or higher. v4 does not work for ghc less then 9.
- uses: mrkkrp/ormolu-action@v15
with:
version: "0.7.2.0"
Loading

0 comments on commit b113f82

Please sign in to comment.