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

Feature/atlas import #1474

Closed
wants to merge 155 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
8435d98
Eerste aanzet Atlas importer
hanjoosten Mar 15, 2024
42bd7f2
Remove fSpec requirement
hanjoosten Mar 15, 2024
e2ee679
Update stack-action to v5
hanjoosten Mar 17, 2024
66071ed
New Origin constructor
hanjoosten Mar 18, 2024
3ff8c70
add Aeson support
hanjoosten Mar 18, 2024
22dbe66
first instances of FromJSON
hanjoosten Mar 18, 2024
d19742b
fix freckle/stack-action calls
hanjoosten Mar 18, 2024
4fb33a4
don't upgrade stack during ci/cd
hanjoosten Mar 19, 2024
3469a4e
First version AtlasImport.hs
SimonvRoozendaalOrdina Mar 22, 2024
a287acb
Adjustment PrettyPrinters.hs to fit proper .adl sturcture
SimonvRoozendaalOrdina Mar 22, 2024
8a937b9
Merge branch 'feature/atlas-import' of https://github.com/AmpersandTa…
SimonvRoozendaalOrdina Mar 22, 2024
d0588ac
Parse text from json to a Term Termprim
hanjoosten Mar 22, 2024
8298e3c
Revert "Adjustment PrettyPrinters.hs to fit proper .adl sturcture"
SimonvRoozendaalOrdina Mar 22, 2024
4cb221c
Include P_Pattern in parser
SimonvRoozendaalOrdina Mar 23, 2024
7405a5a
better parameters for freckle/stack-action
hanjoosten Mar 24, 2024
8857253
- PPurpose werkend behalve voor relaties
SimonvRoozendaalOrdina Mar 26, 2024
39987e6
Merge branch 'feature/atlas-import' of https://github.com/AmpersandTa…
SimonvRoozendaalOrdina Mar 26, 2024
f75e9a9
PPurpose fix, alleen RELATION not working
SimonvRoozendaalOrdina Mar 27, 2024
507e51e
PPurpose finished
SimonvRoozendaalOrdina Mar 28, 2024
6a5e4d5
Representation - only OBJECT not working
SimonvRoozendaalOrdina Mar 29, 2024
b7dd611
Lang working
SimonvRoozendaalOrdina Apr 2, 2024
759b8c0
REPRESENT working
SimonvRoozendaalOrdina Apr 3, 2024
5f96ece
Work in progress:
SimonvRoozendaalOrdina Apr 5, 2024
cfa56dc
- IDENT layout working, terrible .json structure
SimonvRoozendaalOrdina Apr 5, 2024
90002e8
Ident - niet af
SimonvRoozendaalOrdina Apr 8, 2024
bc5d1c5
Classify + MetaData added
SimonvRoozendaalOrdina Apr 8, 2024
cf29b50
- Ident working
SimonvRoozendaalOrdina Apr 10, 2024
f0c7963
RoleRule finished
SimonvRoozendaalOrdina Apr 11, 2024
d5dbd7e
Add ConceptDefinition in formalampersand
hanjoosten Apr 18, 2024
0bb5e87
Rename ConceptDefinition to ConceptDef
hanjoosten Apr 18, 2024
3c66962
- Enforce (werkend, maar leeg vanuit rap dus niet meegegeven)
SimonvRoozendaalOrdina Apr 19, 2024
4ddf798
Bugfixes in transformers
hanjoosten Apr 19, 2024
5640419
The definition is structured as a Meaning in the A-structure
hanjoosten Apr 19, 2024
10615c2
Throw fatal when transformers and .adl script are not in sync
hanjoosten Apr 19, 2024
32ca417
'fix' initial sync errors, in preparation to work with Stef
hanjoosten Apr 28, 2024
e010ed7
PairView / PairViewSegment stuff
hanjoosten Apr 29, 2024
84043ff
Finished sync of PairView and PairViewSegment
hanjoosten Apr 29, 2024
b1b53e1
add represents in generated population script
hanjoosten Apr 30, 2024
3ddf74c
Add warnings for mismatched properties in meatgrinder
hanjoosten Apr 30, 2024
191f142
Pattern synced with Transformers / formal ampersand
hanjoosten May 1, 2024
f859cca
set tag explicitly (no more use of `latest)`
hanjoosten May 1, 2024
aa3b7f0
Add graphviz to image
hanjoosten May 1, 2024
4c571c2
sort installed libraries in RUN statement
hanjoosten May 1, 2024
36675e4
Merge branch 'devcontainer-ghc8-10-7' into main-of-ampersand-4
hanjoosten May 2, 2024
82335ce
rename devcontainer to stress that this is about ampersand 4
hanjoosten May 2, 2024
9f3a3b3
Merge branch 'main-of-ampersand-4' into formalampersand-meatgrinder-u…
hanjoosten May 2, 2024
c6c0f63
Merge branch 'main-of-ampersand-4' into feature/atlas-import
hanjoosten May 2, 2024
1893659
updates for mac-os runners
hanjoosten May 4, 2024
bebf581
mac-os fix
hanjoosten May 4, 2024
3db07ec
update ci2.yml
hanjoosten May 4, 2024
b70bba4
fix error on mac-os: `ghc: could not execute: opt`
hanjoosten May 4, 2024
4f0938e
Use older mac-os version to fix `Make sure you have installed LLVM be…
hanjoosten May 4, 2024
40022b9
Stack still is installed on older version of macos
hanjoosten May 4, 2024
f20ac11
workaround that is already fixed in ampersand 5
hanjoosten May 4, 2024
a653271
A safestring should not accidently be a keyword
hanjoosten May 4, 2024
7730582
more logging to find bug in roundtrip
hanjoosten May 4, 2024
f01a40a
remove previous edits in PrettyPrinters.hs, because of errors in roun…
hanjoosten May 4, 2024
4fe20a0
remove warnings and suggestions
hanjoosten May 4, 2024
ea5beec
Merge branch 'feature/atlas-import' into formalampersand-meatgrinder-…
hanjoosten May 4, 2024
0c60e6b
fix devcontainer name
hanjoosten May 5, 2024
8163df2
disable checking of prototypeContext
hanjoosten May 5, 2024
8adae88
Merge remote-tracking branch 'origin/formalampersand-meatgrinder-upda…
hanjoosten May 5, 2024
2336f3a
Enable checking of prototypetransformers during generation of a proto…
hanjoosten May 6, 2024
4d761e3
Refactor `grind` towards `grindInto`, for stricter usage of grinding
hanjoosten May 7, 2024
cd8ece1
Add check for prototypecontext being in sync
hanjoosten May 7, 2024
a85ebba
bugfix and more refactoring
hanjoosten May 7, 2024
dd2b845
Add missing relations from PrototypeConcept in Transformers.hs
hanjoosten May 7, 2024
886b6ce
remove errors for Origins that are different but reference the same t…
hanjoosten May 8, 2024
2f4e5a2
ATLAS export via 'eigen' printer
SimonvRoozendaalOrdina May 8, 2024
41cf895
Merge branch 'feature/atlas-import' of https://github.com/AmpersandTa…
SimonvRoozendaalOrdina May 8, 2024
d99b840
FormalAmpersand changes in session with Stef
hanjoosten May 9, 2024
6e369a1
Remove specificatin of properties in Transformers, because obsolete
hanjoosten May 9, 2024
f0f6ad5
refactoring
hanjoosten May 10, 2024
44dc571
Enkele transformers ingevuld
hanjoosten May 10, 2024
3b7f3da
wip
hanjoosten May 11, 2024
7d6830b
Even more relations around Interface
hanjoosten May 11, 2024
eb47cc3
Add some ConceptDefs
hanjoosten May 11, 2024
83c830c
Status generated population
hanjoosten May 12, 2024
cfb8664
populate some more relations in FA
hanjoosten May 12, 2024
be3d573
Add support for ssh in devcontainer
hanjoosten May 12, 2024
f763d5c
add mounts to read .ssh
hanjoosten May 12, 2024
7578fe2
eigen Prettyprinter losgehaald van Ampersand voor ATLAS (snellere bui…
SimonvRoozendaalOrdina May 13, 2024
d2e9095
Graphviz extention enabled
hanjoosten May 13, 2024
aec05af
Update devcontainer.json
SimonvRoozendaalOrdina May 13, 2024
7044df5
fix(?) problem with mount in github desktop
hanjoosten May 13, 2024
b73aa35
oops
hanjoosten May 13, 2024
535a71a
Interfaces in FormalAmpersand
hanjoosten May 13, 2024
4a3261e
Further work on documentation pattern
hanjoosten May 13, 2024
189a484
Add githd plugin, to see history info for each line in a file.
hanjoosten May 13, 2024
f5c14ab
Populate relations avoiding new errors due to properties of new relat…
hanjoosten May 13, 2024
43342c3
Some more population
hanjoosten May 14, 2024
6d41e01
Fix Error occurred for Markup when implementing the latest version of…
hanjoosten May 14, 2024
a03ceb4
Changes in FormalAmpersand .adl files
hanjoosten May 22, 2024
8b7a2c8
Add missing relation in transformers of formalampersand
hanjoosten May 22, 2024
63c2ec6
Fix new transformers
hanjoosten May 22, 2024
c3dd26d
Fix error in formalAmpersand
hanjoosten May 22, 2024
2b20486
Consolidate different Names
hanjoosten May 22, 2024
7c63357
Merge branch 'formalampersand-meatgrinder-update-example' into featur…
hanjoosten May 22, 2024
e05f3e1
Temporarily hide issue with totality
hanjoosten May 23, 2024
0795184
Revert "Temporarily hide issue with totality"
hanjoosten May 23, 2024
b9e9f7a
fix bug in instances of ObjectDef
hanjoosten May 23, 2024
532d917
Merge branch 'formalampersand-meatgrinder-update-example' into featur…
SimonvRoozendaalOrdina May 23, 2024
39fae6b
Name not showing bug fix
SimonvRoozendaalOrdina May 23, 2024
828b064
Name not showing bug fix
SimonvRoozendaalOrdina May 23, 2024
e6a46d5
Testcase for issue 1487
hanjoosten May 23, 2024
f0714d4
Fix CONCEPT that is defined but not used doesn't show up in `concs` #…
hanjoosten May 23, 2024
d796e46
On the way to adapting ghc9
hanjoosten May 29, 2024
02052e0
Everything compiles again
hanjoosten May 29, 2024
489db56
Merge branch 'upgrade-GHC' into formalampersand-meatgrinder-update-ex…
hanjoosten May 29, 2024
5881381
Merge branch 'formalampersand-meatgrinder-update-example' into main-o…
hanjoosten May 30, 2024
356f13c
Releasenotes
hanjoosten May 30, 2024
ded8f21
Merge branch 'main-of-ampersand-4' into feature/atlas-import
hanjoosten May 30, 2024
e308b11
Fix error due to changed constructor of PPurpose
hanjoosten May 30, 2024
f11c9dd
kleine verbeteringen, opschoningen en verbeterede testfiles
SimonvRoozendaalOrdina May 30, 2024
39c7923
Update ampersand.cabal
SimonvRoozendaalOrdina May 30, 2024
6aea23b
Merge branch 'feature/atlas-import' of https://github.com/AmpersandTa…
SimonvRoozendaalOrdina May 30, 2024
80a6cda
Layout stuff because of new version of ormolu
hanjoosten May 31, 2024
4d61084
Replace PRef2 with PPurpose
hanjoosten May 31, 2024
a519c6c
- purpose fixed
Svroozendaal May 31, 2024
290ef6c
Retrieve fix for DateTime parser
hanjoosten May 31, 2024
c90ed6d
Revert "Retrieve fix for DateTime parser"
hanjoosten Jun 1, 2024
cbc8add
Also read ' UTC' after datetime if present
hanjoosten Jun 1, 2024
badddcd
Small fix for Windows
hanjoosten Jun 1, 2024
533cc2e
Fix Dockerfile
hanjoosten Jun 1, 2024
7f42788
Minor thing for windows
hanjoosten Jun 1, 2024
9b67e89
Minor enhancement of Setup.hs
hanjoosten Jun 1, 2024
5afbdd8
minor things to ease comming migration
hanjoosten Jun 1, 2024
87e93de
Population still yealds violations
hanjoosten Jun 4, 2024
4599950
Fix population of Meaning
hanjoosten Jun 10, 2024
9bbd879
Merge branch 'feature/meaning-populate-text' into main-of-ampersand-4
hanjoosten Jun 10, 2024
2b56355
testing files
Svroozendaal Jun 13, 2024
a2d943f
Prettyprinter update
Svroozendaal Jun 13, 2024
c145aad
Merge branch 'feature/atlas-import' of https://github.com/AmpersandTa…
Svroozendaal Jun 13, 2024
de22bec
Squashed commit of the following:
Svroozendaal Jun 13, 2024
bd32036
- meaning & definition
Svroozendaal Jun 17, 2024
a77057e
Add ShowAdl for PairView
hanjoosten Jun 18, 2024
19985a8
Merge remote-tracking branch 'origin/add-showADL-Pairview' into featu…
Svroozendaal Jun 18, 2024
ff418b7
testfile update
Svroozendaal Jun 18, 2024
a026be0
term.adl spell out relations to fix error
Svroozendaal Jun 18, 2024
ecfe64e
Revert "term.adl spell out relations to fix error"
hanjoosten Jun 18, 2024
692f999
fix execengine rule to delete ShowADL atoms
hanjoosten Jun 18, 2024
e781fe7
Merge branch 'add-showADL-Pairview' into main-of-ampersand-4
hanjoosten Jun 18, 2024
48a1b6e
populate message
hanjoosten Jun 18, 2024
418fce5
Message should not be a type of it's own. Markup is intended.
hanjoosten Jun 18, 2024
513215c
Merge branch 'add-showADL-Pairview' into feature/atlas-import
Svroozendaal Jul 3, 2024
4e6be04
eerste versie bug fix (error)
Svroozendaal Jul 5, 2024
e138dc1
FUN & BIJ added to Parser Lexer
Svroozendaal Jul 9, 2024
9e60819
code cleanup
Svroozendaal Jul 9, 2024
39c442f
testfiles
Svroozendaal Jul 10, 2024
bb7f225
Fix instanceList of Meaning
hanjoosten Jul 10, 2024
d5086e5
See https://github.com/AmpersandTarski/Ampersand/issues/1489#issuecom…
hanjoosten Jul 10, 2024
476318b
Merge branch 'Add-prop-BIJ-FUN' into feature/atlas-import
hanjoosten Jul 10, 2024
a0f6675
Merge branch 'add-message-to-rule' into feature/atlas-import
hanjoosten Jul 10, 2024
98a0cac
Restore restrictions
hanjoosten Jul 10, 2024
b124f99
Refactor (sorting) transformers
hanjoosten Aug 4, 2024
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
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.
27 changes: 16 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
{
"name": "DevContainer for Ampersand",
"name": "Ampersand 4 devcontainer",
// "remoteUser": "root",
"runArgs": [],
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
"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
205 changes: 106 additions & 99 deletions .github/workflows/ci2.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,106 @@
# Inspired by https://tech.freckle.com/2021/05/18/haskell-on-actions/
name: Build and test 🚀
on:
push:
branches:
- "**" # Only trigger on branches (i.e. not tags, ..)
paths-ignore:
- "docs/**" # If only documentation changes, no need to build.
jobs:
build-and-test-docker:
name: Build with Docker
runs-on: ubuntu-latest
env:
DOCKER_AMPERSAND_IMAGE: ampersandtarski/ampersand
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Prepare for docker
run: |
echo Running on branch ${GITHUB_REF##*/}
docker version

- name: Build final image
run: docker build . --tag ${DOCKER_AMPERSAND_IMAGE}:latest --build-arg GIT_SHA=${{ github.sha }} --build-arg GIT_Branch=${{ github.ref }}

# For main branch push latest to DockerHub
- name: Login to DockerHub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push latest
if: github.ref == 'refs/heads/main'
run: docker push ${DOCKER_AMPERSAND_IMAGE}:latest

build-and-test-ubuntu:
name: Build and test on ubuntu-latest 🏗 🧪
runs-on: ubuntu-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"
- name: Build and test 🏗 🧪
uses: freckle/stack-action@main # stack-action does all these steps: dependencies, build, test.
with:
stack-arguments: "--copy-bins --flag ampersand:buildAll"

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"
- name: Build and test 🏗 🧪
uses: freckle/stack-action@main
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
- 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@main
with:
stack-arguments: "--copy-bins --flag ampersand:buildAll"
# Inspired by https://tech.freckle.com/2021/05/18/haskell-on-actions/
name: Build and test 🚀
on:
push:
branches:
- "**" # Only trigger on branches (i.e. not tags, ..)
paths-ignore:
- "docs/**" # If only documentation changes, no need to build.
jobs:
build-and-test-docker:
name: Build with Docker
runs-on: ubuntu-latest
env:
DOCKER_AMPERSAND_IMAGE: ampersandtarski/ampersand
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Prepare for docker
run: |
echo Running on branch ${GITHUB_REF##*/}
docker version

- name: Build final image
run: docker build . --tag ${DOCKER_AMPERSAND_IMAGE}:latest --build-arg GIT_SHA=${{ github.sha }} --build-arg GIT_Branch=${{ github.ref }}

# For main branch push latest to DockerHub
- name: Login to DockerHub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push latest
if: github.ref == 'refs/heads/main'
run: docker push ${DOCKER_AMPERSAND_IMAGE}:latest

build-and-test-ubuntu:
name: Build and test on ubuntu-latest 🏗 🧪
runs-on: ubuntu-latest
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
- name: Build and test 🏗 🧪
uses: freckle/stack-action@v5 # stack-action does all these steps: dependencies, build, test.
with:
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-12
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@v5
with:
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
upgrade-stack: false
cache-save-always: true

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@v5
with:
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
upgrade-stack: false
cache-save-always: true
Loading
Loading