Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cihanandac committed Jan 18, 2023
0 parents commit 53207cf
Show file tree
Hide file tree
Showing 240 changed files with 35,819 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# EditorConfig Configurtaion file, for more details see:
# https://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types

# top-most EditorConfig file:
# Will ignore other EditorConfig files in Home directory or upper tree level.
root = true


[*] # For All Files
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set default charset
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off

[*.{py,cfg,ini}]
# 4 space indentation
indent_size = 4

[*.{html,dtml,pt,zpt,xml,zcml,js,json,less,css,yml,yaml}]
# 2 space indentation
indent_size = 2

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
indent_style = tab
indent_size = unset
tab_width = unset
135 changes: 135 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Backend CI

on:
push:
paths:
- "backend/**"
- ".github/workflows/backend.yml"
workflow_dispatch:

jobs:

black:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Run check
uses: plone/code-analysis-action@v2
with:
base_dir: 'backend'
check: 'black'

flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Run check
uses: plone/code-analysis-action@v2
with:
base_dir: 'backend'
check: 'flake8'

isort:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Run check
uses: plone/code-analysis-action@v2
with:
base_dir: 'backend'
check: 'isort'

zpretty:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Run check
uses: plone/code-analysis-action@v2
with:
base_dir: 'backend'
check: 'zpretty'

tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.11
plone:
- "6.0.0"

defaults:
run:
working-directory: ./backend

steps:
- uses: actions/checkout@v2

- name: Setup Plone ${{ matrix.plone }} with Python ${{ matrix.python }}
uses: plone/setup-plone@v2.0.0
with:
python-version: ${{ matrix.python }}
plone-version: ${{ matrix.plone }}

- name: Install package
run: |
pip install mxdev
mxdev -c mx.ini
pip install -r requirements-mxdev.txt
- name: Run tests
run: |
PYTHONWARNINGS=ignore zope-testrunner --auto-color --auto-progress --test-path src/zeeuwsmuseumwebsite/src/
release:
runs-on: ubuntu-latest
needs: [black, flake8, isort, zpretty, tests]

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
intkbv/zeeuwsmuseumwebsite-backend
labels: |
org.label-schema.docker.cmd=docker run -d -p 8080:8080 intkbv/zeeuwsmuseumwebsite-backend:latest
tags: |
type=ref,event=branch
type=sha
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
context: backend
file: backend/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
138 changes: 138 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Frontend CI

on:
push:
paths:
- "frontend/**"
- ".github/workflows/frontend.yml"
workflow_dispatch:

env:
node-version: 16.x

jobs:

eslint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
cache-dependency-path: 'frontend/yarn.lock'

- name: Install packages
run: make install

- name: Lint
run: yarn run lint:ci

prettier:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Run Prettier
run: npx prettier@2.0.5 --single-quote --check 'src/**/*.{js,jsx,ts,tsx,css,scss}' --config=package.json


i18n:
name: i18n sync
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend

steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
cache-dependency-path: 'frontend/yarn.lock'

- name: Install packages
run: make install

- name: Test i18n sync
run: make i18n-ci

unit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
cache-dependency-path: 'frontend/yarn.lock'

- name: Install packages
run: make install

- name: Test
run: make test

release:
runs-on: ubuntu-latest
needs: [eslint, prettier, i18n, unit]

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
intkbv/zeeuwsmuseumwebsite-frontend
labels: |
org.label-schema.docker.cmd=docker run -d -p 3000:3000 intkbv/zeeuwsmuseumwebsite-frontend:latest
tags: |
type=ref,event=branch
type=sha
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
context: frontend/
file: frontend/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: $${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.vscode
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "eslint.workingDirectories": ["./frontend"] }
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 2023-01-18

- Initial version [intkbv]
Loading

0 comments on commit 53207cf

Please sign in to comment.