Skip to content

Commit

Permalink
Merge pull request #1079 from AmpersandTarski/development
Browse files Browse the repository at this point in the history
Release 4.0.0
  • Loading branch information
hanjoosten authored May 28, 2020
2 parents fd90ea3 + be776fb commit 4b97530
Show file tree
Hide file tree
Showing 289 changed files with 11,605 additions and 8,275 deletions.
48 changes: 48 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
cache:
- '%APPDATA%\cabal'
- '%APPDATA%\ghc'
- '%APPDATA%\stack'

install:
- choco install ghc --version 8.2.2
- choco install haskell-stack
- refreshenv
- cabal update
- cabal install happy --overwrite-policy=always

# perform the typical stack build, and also install the
# ampersand.exe file that we will mark as an artifact
build_script:
# Suppress output from stack setup, as there is a lot and it's not necessary.
- stack setup --no-terminal > nul
- stack build --only-snapshot --no-terminal
- stack --local-bin-path . install ampersand
# Set a magical environment variable
- cmd: for /f %%i in ('stack exec ampersand -- -v') do set AMPERSAND_VERSION=%%i
- cmd: pwd
- cmd: where ampersand
- cmd: where stack
# mark the file(s) as an artifact; this means AppVeyor will hang on to it after the build completes:
artifacts:
- path: ampersand.exe
name: Windows_binary

# Auto-deploy
# specify that, for each build that completes, AppVeyor
# should push a release with the right tag to
# the GitHub releases page!
# We only release when the branch == master.
# (Note: probably we would want to be a bit more
# elaborate about when we push to the releases page; making sure
# that we include proper release notes, etc.)
deploy:
- provider: GitHub
tag: '$(AMPERSAND_VERSION)'
release: '$(AMPERSAND_VERSION)'
auth_token:
secure: B9wxH2Me3jIbEn9xlvIY9SEWdELRgKMtEZeQZmJQm5wMGjp4YF4wQmAHCy3ofTJG
artifact: Windows_binary
on:
branch: master

10 changes: 8 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
.stack-work
*.lock
.*
ArchitectureAndDesign/
docker/
miscellaneous/
*.lock
README*
travis_long
.dockerignore
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.xlsx diff=excel
*.xls diff=excel
34 changes: 13 additions & 21 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
<!-- Thanks for contributing to Ampersand! Please pick a clear title and proceed. -->
<!-- Please note: If your issue is about RAP3, please report it over there:
https://github.com/AmpersandTarski/RAP/issues
-->
<!-- Thanks for contributing to Ampersand! Please pick a clear title and proceed.-->
<!-- Please note: If your issue is about RAP3, please report it over there:-->
<!-- https://github.com/AmpersandTarski/RAP/issues -->

#### Version of ampersand that was used
# What happened

# What I expected

#### What I expected
# Version of ampersand that was used

# Steps to reproduce

#### What happened instead


#### Steps to reproduce
1.
1.
2.
3.
4.

# Screenshot / Video

#### Screenshot / Video


#### Context / Source of ampersand script
<!-- Optional: share your script if possible. It helps us reproduce the problem. Please try to keep the scripts tiny
We'd also love to know how you found the bug: #dogfooding, #manual-testing, #automated-testing, or #user-report if applicable.
If requesting a new feature, explain why you'd like to see it added.
-->
# Context / Source of ampersand script
<!-- Optional: share your script if possible. It helps us reproduce the problem. Please try to keep the scripts tiny-->

<!-- We'd also love to know how you found the bug: #dogfooding, #manual-testing, #automated-testing, or #user-report if applicable.-->

<!-- If requesting a new feature, explain why you'd like to see it added.-->
69 changes: 69 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Continuous Integration
on:
push:
branches: # empty list to only trigger on branches (i.e. not tags, ..)

env:
DOCKER_AMPERSAND_IMAGE: docker.pkg.github.com/ampersandtarski/ampersand/ampersand
DOCKER_AMPERSAND_IMAGE_DEV: docker.pkg.github.com/ampersandtarski/ampersand/ampersand:development
# IMAGE_BRANCH_TAG: ${DOCKER_AMPERSAND_IMAGE}:${GITHUB_REF##*/} # Does not work because bash expression is not allowed here

jobs:
build:
name: Build
runs-on: ubuntu-latest
# env:

# See: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables
# Because steps run in their own process, changes to environment variables are not preserved between steps
steps:
- name: Checkout repository
uses: actions/checkout@master # this step reuses a default Github action; see: https://github.com/actions

- name: Prepare for docker
run: |
echo Running on branch ${GITHUB_REF##*/}
docker version
docker login docker.pkg.github.com -u ${GITHUB_ACTOR} -p ${{secrets.GITHUB_TOKEN}}
- name: Pull dev image to use as cache
run: docker pull ${DOCKER_AMPERSAND_IMAGE_DEV} || true

# This step only builds the 'buildstage' stage (see `--target buildstage`)
- name: Build buildstage
run: |
# See: https://andrewlock.net/caching-docker-layers-on-serverless-build-hosts-with-multi-stage-builds---target,-and---cache-from/ to understand why we use --target and --cache-from here
docker build . --cache-from ${DOCKER_AMPERSAND_IMAGE_DEV} --target buildstage --tag ${DOCKER_AMPERSAND_IMAGE}:${GITHUB_REF##*/} --build-arg GIT_SHA=${{ github.sha }} --build-arg GIT_Branch=${{ github.ref }}
# Step disabled because it clutters the package registry on github. Currently public packages cannot be deleted on github.
# # This step allows for quicker builds in a future run (see step above where image is pulled to use as cache)
# - name: Push buildstage
# run: docker push ${DOCKER_AMPERSAND_IMAGE}:${GITHUB_REF##*/}

# This step build the final (slim) image
- name: Build final image
run: docker build . --cache-from ${DOCKER_AMPERSAND_IMAGE}:${GITHUB_REF##*/} --tag ${DOCKER_AMPERSAND_IMAGE}:latest --build-arg GIT_SHA=${{ github.sha }} --build-arg GIT_Branch=${{ github.ref }}

# Push latest
- name: Push ampersand:latest
if: github.ref == 'refs/heads/development'
run: |
docker push ${DOCKER_AMPERSAND_IMAGE_DEV}
docker push ${DOCKER_AMPERSAND_IMAGE}:latest
# See: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts
test:
name: Test
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

release:
name: Release
if: github.ref == 'refs/heads/master'
needs: [build, test]
runs-on: ubuntu-latest
steps:
- run: echo This is only a test

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ stack.yaml.lock

# Temporarily disable ampersand.cabal (See issue #931)
/ampersand.cabal
/stack.yaml.lock

StaticFiles_Generated.hs
BuildInfo_Generated.hs
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ before_install:
- stack setup
- stack exec -- ghc --version


install:
- echo "Starting install"
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
Expand All @@ -139,6 +140,7 @@ install:
stack build `# build is the common task which is composable.` \
--test `# run the tests` \
--copy-bins `# install executables to the path` \
--haddock `# create haddock documentation, thus ensuring that haddock parse rules are enforsed.` \
--no-terminal `# fixes bug with sticky output on travis` \
$ARGS `#` \
--flag ampersand:buildAll `# build all executables of ampersand`
Expand Down
4 changes: 2 additions & 2 deletions AmpersandData/FormalAmpersand/AST.adl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CONTEXT Ampersand IN ENGLISH
CONTEXT Ampersand IN ENGLISH
--! It is allowed to change texts and/or the order of texts IF AND ONLY IF this is also done in the corresponding Haskell files !--
INCLUDE "Concepts.adl"
INCLUDE "AST.ifc"
--INCLUDE "AST.ifc"
--INCLUDE "MinimalAST.xlsx" -- Contains minimal population. Anything discarded from it must violate an invariant
INCLUDE "Contexts.adl"
INCLUDE "Relations.adl"
Expand Down
2 changes: 1 addition & 1 deletion AmpersandData/FormalAmpersand/AST.docadl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ An Ampersand professional uses expressions to calculate with language and to spe
An expression combines relations with operators.
That results in new relations, the population of which can be calculated from the constituent parts.
This is similar to arithmetic, where for instance the result of expression $(3+5)\times 2$ can be calculated from the constituent numbers.
In ampersand, you calculate with relations rather than numbers.
In Ampersand, you calculate with relations rather than numbers.
\subsubsection*{Example}
The problem of identifying which persons have been using an information system can be solved by making rules
about log-in, users and sessions.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT PrototypeFramework IN ENGLISH
CONTEXT PrototypeContxt IN ENGLISH

INCLUDE "Interfaces.adl"
INCLUDE "Interfaces.ifc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTEXT SystemContext IN ENGLISH
{-This file contains the heritage documentation of SystemContext.adl.
CONTEXT PrototypeContext IN ENGLISH
{-This file contains the heritage documentation of PrototypeContext.adl.
This heritage documentation, however, still has several problems, e.g:
- The default texts are not ENGLISH, even though this is specified in the CONTEXT statement.
- The texts in Dutch say different things that the texts in English.
Expand Down
File renamed without changes.
48 changes: 28 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
FROM haskell:8.6.5 AS buildstage
# The purpose of this docker file is to produce a latest Ampersand-compiler in the form of a docker image.
# Purpose: a light-weight container can copy ampersand executables from /root/.local/bin, ignoring the build-stuff such as source code and setup-work
# Instruction: If '.' (your working directory) contains this Dockerfile, run "docker build -t docker.pkg.github.com/ampersandtarski/ampersand/ampersand:latest ."
FROM haskell:8.8 AS buildstage

# The Haskell version number must be consistent with ./stack.yaml to ensure successful compilation.
RUN mkdir /opt/ampersand
WORKDIR /opt/ampersand

# build from the Ampersand source code directory
WORKDIR /Ampersand/
# Start with a docker-layer that contains build dependencies, to maximize the reuse of these dependencies by docker's cache mechanism.
# Only updates to the files stack.yaml package.yaml will rebuild this layer; all other changes use the cache.
# Expect stack to give warnings in this step, which you can ignore.
# Idea taken from https://medium.com/permutive/optimized-docker-builds-for-haskell-76a9808eb10b
COPY stack.yaml package.yaml /opt/ampersand/
RUN stack build --dependencies-only

# clone the ampersand source files ('git clone' requires the directory to be empty)
RUN git clone https://github.com/AmpersandTarski/Ampersand/ .
# Copy the rest of the application
# See .dockerignore for files/folders that are not copied
COPY . /opt/ampersand

# get Ampersand sources in the desired version
RUN git checkout feature/Archimate3
# These ARGs are available as ENVs in next RUN and are needed for compiling the Ampersand compiler to have the right versioning info
ARG GIT_SHA
ARG GIT_Branch

# Or alternatively, just copy your Ampersand working directory (i.e. your own clone of Ampersand) into the build
# COPY . .

# set up Haskell stack; downloads approx 177MB
# Don't worry about the correct version of ghc. It is specified in stack.yaml
# RUN stack setup

# installs Ampersand executables in /root/.local/bin
# Build Ampersand compiler and install in /root/.local/bin
RUN stack install

# show the results of the build stage
RUN ls -al /root/.local/bin
# Display the resulting Ampersand version and SHA
RUN /root/.local/bin/ampersand --version

# Create a light-weight image that has the Ampersand compiler available
# to run ampersand from the command line.
# call with docker run -it \ # run interactively on your CLI
# --name devtest \ # name of the container (so you can remove it with `docker rm devtest`)
# -v ${pwd}:/scripts \ # mount the current working directory of your CLI on the container directory /scripts
# <your subcommand> # e.g. check, documentation, proto
FROM ubuntu

RUN apt-get update && apt-get install -y graphviz

VOLUME ["/scripts"]

COPY --from=buildstage /root/.local/bin/ampersand /bin/
COPY --from=buildstage /root/.local/bin/ampersand /bin/ampersand

WORKDIR /scripts

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Ampersand
# Ampersand

[![Build Status](https://travis-ci.org/AmpersandTarski/Ampersand.svg?branch=master)](https://travis-ci.org/AmpersandTarski/Ampersand)
[![Build status](https://ci.appveyor.com/api/projects/status/ai0pwvb7corwkjjm?svg=true)](https://ci.appveyor.com/project/hanjoosten/ampersand)
[![Latest Release](https://img.shields.io/github/release/AmpersandTarski/Ampersand.svg)](https://github.com/AmpersandTarski/Ampersand/releases/latest)

## Recent activity
[![Throughput Graph](https://graphs.waffle.io/AmpersandTarski/Ampersand/throughput.svg)](https://waffle.io/AmpersandTarski/Ampersand/metrics)

## Releases

Check out the [release notes](https://github.com/AmpersandTarski/Ampersand/blob/development/ReleaseNotes.md) and [![all Releases](https://img.shields.io/github/release/AmpersandTarski/Ampersand.svg)](https://github.com/AmpersandTarski/Ampersand/releases)

## Documentation

The best place to look at if you are new to Ampersand, and you want to install the software, is at our [documentation](http://ampersandtarski.gitbooks.io/documentation/). Anyone can add comments if you read the documentation online. Please do so if there is anything you miss in the documentation.
The best place to look at if you are new to Ampersand, and you want to install the software, is at our [documentation](https://ampersandtarski.gitbook.io/documentation/). Anyone can add comments if you read the documentation online. Please do so if there is anything you miss in the documentation.

There is also some [documentation for the developers of ampersand](http://ampersandtarski.gitbooks.io/the-tools-we-use-for-ampersand/).
There is also some [documentation for the developers of ampersand](https://ampersandtarski.gitbook.io/the-tools-we-use-for-ampersand/).
26 changes: 25 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Release notes of Ampersand

## v4.0.0 (23 may 2020)

* Refactor Docker image for Ampersand compiler
* Add continuous integration via Github Actions. With cache.
* [Issue #991](https://github.com/AmpersandTarski/Ampersand/issues/991) CLI interface has changed. Changes are documented in [Commands.md](https://github.com/AmpersandTarski/Ampersand/blob/development/commands.md)
* [Issue #1029](https://github.com/AmpersandTarski/Ampersand/issues/1029) Fixed detection of rules with same name.
* [Issue #1047](https://github.com/AmpersandTarski/Ampersand/issues/1047) Non-existing directory is generated automagically when required for output.
* [Issue #999](https://github.com/AmpersandTarski/Ampersand/issues/999) Treat all concepts in a cycle in CLASSIFY statements as aliases of a single concept.
* [Issue #1056](https://github.com/AmpersandTarski/Ampersand/issues/#1056) Bugfix in .xlsx parser
* [Issue #1054](https://github.com/AmpersandTarski/Ampersand/issues/#1054) Ampersand daemon now also reports type errors
* [Issue #1063](https://github.com/AmpersandTarski/Ampersand/issues/#1063) Return violations of invariants with standard check
* [Issue #735](https://github.com/AmpersandTarski/Ampersand/issues/735) Upgrade to pandoc 2.9.

* Remove option --skip-composer. Relates to topic of [Archicture of Ampersand compiler](https://github.com/AmpersandTarski/Ampersand/issues/903)
* Introduce option --[no-]frontend to do/don't generate frontend (i.e. javascript and html files for Angular app)
* Introduce option --[no-]backend to do/don't generate backend (i.e. json model for php framework)
* Remove default value 'customizations' for option --customizations. Copying folders must be explicitly specified.
* Change default output folder to .proto instead of '<scriptname.adl>.proto' for prototype generation.

## v3.17.5 (3 january 2020)

* Update to prototype framework v1.4.0

## v3.17.4 (13 september 2019)

* Upgrade to [LTS Haskell 14.5 (ghc-8.6.5)](https://www.stackage.org/lts-14.5)
Expand All @@ -15,6 +38,7 @@

* Again some major refactoring has been done to leverage the [RIO library](https://haskell.fpcomplete.com/library/rio).
* [Issue #976](https://github.com/AmpersandTarski/Ampersand/issues/976) Lines in --deamon configuration file can be commented out by prepending such line with "#" or "--" (MUST be at beginning of line)
* [Issue #971](https://github.com/AmpersandTarski/Ampersand/issues/971) The functionality of meatgrinding has been refactored. It is now far more composable. It is expected that in the near future this will lead to a set of different switches.

## v3.17.1 (7 june 2019)

Expand Down Expand Up @@ -151,7 +175,7 @@

It has taken some time since the last release. This release has some major work in it, and also a change of syntax of scripts. Unfortunately this is not downward compatible.

* Introduction of SystemContext.adl, which will be required for new interface generation, which will become available in some future release
* Introduction of PrototypeContext.adl, which will be required for new interface generation, which will become available in some future release
* Upgraded to LTS-9.2
* [Issue #713](https://github.com/AmpersandTarski/Ampersand/issues/713) New syntax for singleton expressions

Expand Down
Loading

0 comments on commit 4b97530

Please sign in to comment.