Skip to content

Commit

Permalink
Setup GitHub Actions for the monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
Juholei committed Dec 20, 2023
1 parent 901c49e commit 945ab39
Show file tree
Hide file tree
Showing 6 changed files with 272 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/renovate-bot-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"branchPrefix": "renovate-fix/",
"gitAuthor": "Renovate Bot <[email protected]>",
"platform": "github",
"repositories": [
"solita/etp-core"
]
}
76 changes: 76 additions & 0 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: ci

on:
pull_request:
push:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-core/etp-backend

steps:
- uses: actions/checkout@v3
- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.11.1.1273
- name: Build
run: clojure -M:uberjar

lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-core/etp-backend

steps:
- uses: actions/checkout@v3
- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.11.1.1273
- name: Lint
run: clojure -M:lint --fail-level error

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.11.1.1273
- name: Install Libreoffice
run: sudo apt-get update && sudo apt-get install libreoffice
- name: Docker Compose
working-directory: etp-core/docker
run: ./start.sh
- name: Test
working-directory: etp-core/etp-backend
run: clojure -M:dev:test-ci
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure()
with:
report_paths: 'etp-backend/target/test.xml'
92 changes: 92 additions & 0 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-front
strategy:
matrix:
node-version: [ 18.x, 20.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present

test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-front
strategy:
matrix:
node-version: [ 18.x, 20.x ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test

format:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-front
strategy:
matrix:
node-version: [ 18.x, 20.x ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run check-format

storybook:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-front
strategy:
matrix:
node-version: [ 18.x, 20.x ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run storybook:build
53 changes: 53 additions & 0 deletions .github/workflows/ci-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-public
strategy:
matrix:
node-version: [ 18.x, 20.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run check-format

format:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-public
strategy:
matrix:
node-version: [ 18.x, 20.x ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run check-format
24 changes: 24 additions & 0 deletions .github/workflows/nvd-clojure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: nvd-clojure

on:
schedule:
- cron: '0 2 * * 1'

jobs:
nvd:
runs-on: ubuntu-latest
defaults:
run:
working-directory: etp-core/etp-backend
container:
image: clojure:openjdk-17-tools-deps

steps:
- uses: actions/checkout@v3
- name: Run nvd
run: ./nvd.sh
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure()
with:
report_paths: 'etp-backend/target/nvd/dependency-check-junit.xml'
19 changes: 19 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: renovate

on:
schedule:
- cron: '10 0/1 * * *' # Start at ten past to avoid rush hour

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Self-hosted Renovate
uses: renovatebot/[email protected]
with:
token: ${{ secrets.RENOVATE_TOKEN }}
configurationFile: .github/renovate-bot-config.json
env:
LOG_LEVEL: 'debug'

0 comments on commit 945ab39

Please sign in to comment.