Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Aug 23, 2024
2 parents 46b561a + b3b08c1 commit 03b00d1
Show file tree
Hide file tree
Showing 112 changed files with 7,992 additions and 20,975 deletions.
128 changes: 128 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
on: pull_request
name: Review

jobs:
changelog:
runs-on: ubuntu-latest
name: Changelog should be updated
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Git fetch
run: git fetch

- name: Check that changelog has been updated.
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

markdown-coding-standards:
name: Markdown coding standards
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Coding standards
run: |
docker run --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint $(git ls-files *.md)
composer-normalize:
name: composer-normalize
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- run: |
docker network create frontend
docker compose run --user root --rm phpfpm composer install
docker compose run --user root --rm phpfpm composer normalize
coding-standards-phpcs:
name: coding-standards-check/phpcs
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- run: |
docker network create frontend
docker compose run --user root --rm phpfpm composer install
docker compose run --user root --rm phpfpm composer coding-standards-check/phpcs
coding-standards-twig-cs-fixer:
name: coding-standards-check/twig-cs-fixer
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- run: |
docker network create frontend
docker compose run --user root --rm phpfpm composer install
docker compose run --user root --rm phpfpm composer coding-standards-check/twig-cs-fixer
coding-standards-assets:
name: coding-standards-check/assets
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- run: |
docker network create frontend
docker compose run --user root --rm node yarn install
docker compose run --user root --rm node yarn coding-standards-check
install-site:
name: Check that site can be installed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install site
run: |
docker network create frontend
docker compose pull
docker compose up --detach
# Important: Use --no-interaction to make https://getcomposer.org/doc/06-config.md#discard-changes have effect.
docker compose exec --user root phpfpm composer install --no-interaction
# Install the site
docker compose exec --user root phpfpm vendor/bin/drush site:install --existing-config --yes
# Build theme assets
docker compose run --user root --rm node yarn install
docker compose run --user root --rm node yarn build
- name: Open site
run: |
echo $(docker compose exec phpfpm vendor/bin/drush --uri=http://$(docker compose port nginx 8080) user:login)
config-check:
name: Check that config is up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install site
run: |
docker network create frontend
docker compose pull
docker compose up --detach
# Important: Use --no-interaction to make https://getcomposer.org/doc/06-config.md#discard-changes have effect.
docker compose exec --user root phpfpm composer install --no-interaction
# Install the site
docker compose exec --user root phpfpm vendor/bin/drush site:install --existing-config --yes
- name: Export config
run: docker compose exec --user root phpfpm vendor/bin/drush config:export --yes
- name: Check for changes in config
run: git diff --diff-filter=ACMRT --exit-code config/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,7 @@ node_modules

# Docker
.env.docker.local
.twig-cs-fixer.cache

# Assets
web/themes/custom/giv_din_stemme_theme/build/
11 changes: 0 additions & 11 deletions .markdownlint.json

This file was deleted.

13 changes: 13 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"default": true,
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
"line-length": {
"line_length": 120,
"code_blocks": false,
"tables": false
},
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md
"no-duplicate-heading": {
"siblings_only": true
}
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore artifacts:
build
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ See [keep a changelog] for information about writing changes to this log.

## [Unreleased]

* Initial project.
- [PR-13](https://github.com/itk-dev/giv-din-stemme/pull/13)
Mobile optimization.

- Initial project.
65 changes: 52 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,56 @@ docker network create --driver=bridge --attachable --internal=false frontend

### Building assets for the frontend

Run `itkdev-docker-compose run node yarn watch` to continuesly build assets uppon file changes.
Run the following to install dependencies with yarn.

Run `itkdev-docker-compose run node yarn build` to build assets once.
```shell name="assets-install"
itkdev-docker-compose run node yarn install
```

Run the following to continuesly build assets uppon file changes.

```shell name="assets-watch"
itkdev-docker-compose run node yarn watch
```

Run the following to build assets once.

```shell name="assets-build"
itkdev-docker-compose run node yarn build
```

### Site installation

Run the following commands to set up the site. This will run a normal Drupal site installation with the existing
configuration that comes with this project.

```shell
itkdev-docker-compose up -d
```shell name="site-up"
itkdev-docker-compose up --detach
itkdev-docker-compose composer install
itkdev-docker-compose drush site-install minimal --existing-config -y
itkdev-docker-compose drush site-install --existing-config --yes
```

When the installation is completed, that admin user is created and the password for logging in the outputted. If you
forget the password, use drush uli command to get a one-time-login link (not the uri here only works if you are using
trafik).

```shell
itkdev-docker-compose drush uli --uri="http://givdinstemme.local.itkdev.dk/"
```shell name="site-login"
itkdev-docker-compose drush --uri="https://givdinstemme.local.itkdev.dk/" user:login
```

### Access the site

If you are using out `itkdev-docker-compose` simple use the command below to åbne the site in you default browser.

```shell
```shell name="site-open"
itkdev-docker-compose open
```

Alternatively you can find the port number that is mapped nginx container that server the site at `http://0.0.0.0:PORT`
by using this command:

```shell
docker compose port nginx 8080
open "http://$(docker compose port nginx 8080)"
```

### Drupal config
Expand All @@ -75,10 +89,6 @@ Import config from config files:
itkdev-docker-compose drush config:import
```

### Coding standards

@todo Add description about running and applying coding standards

## Production setup

@todo Write this section.
Expand Down Expand Up @@ -129,3 +139,32 @@ $config['openid_connect.client.connection']['settings']['token_endpoint'] = '…
$config['openid_connect.client.connection']['settings']['userinfo_endpoint'] = '…';
$config['openid_connect.client.connection']['settings']['end_session_endpoint'] = '…';
```

### Coding standards

``` shell name=coding-standards-composer
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm composer normalize
```

``` shell name=coding-standards-php
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm composer coding-standards-apply/phpcs
docker compose run --rm phpfpm composer coding-standards-check/phpcs
```

``` shell name=coding-standards-twig
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm composer coding-standards-apply/twig-cs-fixer
docker compose run --rm phpfpm composer coding-standards-check/twig-cs-fixer
```

``` shell name=coding-standards-markdown
docker run --platform linux/amd64 --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint $(git ls-files *.md) --fix
docker run --platform linux/amd64 --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint $(git ls-files *.md)
```

```shell name="coding-standards-assets"
itkdev-docker-compose run node yarn coding-standards-apply
itkdev-docker-compose run node yarn coding-standards-check
```
Loading

0 comments on commit 03b00d1

Please sign in to comment.