Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches: [main, develop, master]
types: [opened, synchronize, ready_for_review]

# cancel running actions for current PR if new commits were pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
depandabot-modify-changelog:
if: ${{ github.actor == 'dependabot[bot]' }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- run: |
insertText="### dependabot: \\\#${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}"

# check if file doesn't contain the text already
if ! grep -q "$insertText" CHANGELOG.md; then
echo "Changelog entry not found, adding it"
sed -i "/## \[Unreleased\]/a \
$insertText" CHANGELOG.md
else
echo "Changelog entry already exists, skipping"
exit 0
fi

- name: initialize mandatory git config
run: |
git config user.name "GitHub Changelog Bot"
git config user.email changelog-bot@neolution.ch

- run: npx prettier --write CHANGELOG.md

- name: commit and push
run: |
git add CHANGELOG.md
git commit -m "Add changelog entry for ${{ github.event.pull_request.title }}"
git push

check-changelog:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45

- name: Check if changelog was touched
run: |
changelogFound=$(echo ${{ steps.changed-files.outputs.all_changed_files }} | grep -ow "CHANGELOG.md" | wc -w)
if [ $changelogFound -eq 0 ]; then
echo '### :boom: Please update the changelog accordingly (https://keepachangelog.com)' >> $GITHUB_STEP_SUMMARY
exit 1
fi

build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x, 24.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- run: rm -rf node_modules && yarn install --frozen-lockfile
- run: npm run lint
- run: npm run build --if-present
- run: npm run test:ci
32 changes: 0 additions & 32 deletions .github/workflows/test.yml

This file was deleted.

Loading