Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'build/optimize-setup'
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Feb 20, 2024
2 parents 67e6a93 + a9807c1 commit 195fcb7
Show file tree
Hide file tree
Showing 137 changed files with 1,402 additions and 678 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# https://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = tab
max_line_length = 160
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
indent_style = space
insert_final_newline = false
trim_trailing_whitespace = false

[*.yml]
indent_style = space
8 changes: 7 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
/**
* Import types with `import type` instead of `import`.
*/
'@typescript-eslint/consistent-type-imports': 'warn',
},
};
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
labels:
- dependabot
schedule:
interval: weekly
- package-ecosystem: 'npm'
directory: '/'
labels:
- dependabot
schedule:
interval: 'weekly'
7 changes: 7 additions & 0 deletions .github/dod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dod:
- Meaningful title and valuable description in the pull request
- Pull request is linked to an issue
- All changes relate to the issue
- A11y tests performed successfully
- Code review carried out successfully
- Manual test performed successfully
72 changes: 72 additions & 0 deletions .github/workflows/auto-dependency-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Auto dependency updater

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

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: 'develop'

# - uses: pnpm/action-setup@v3
# with:
# run_install: false
# version: 8
# - uses: actions/setup-node@v4
# with:
# cache: pnpm
# node-version: 20

# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Install Node.js
uses: actions/setup-node@v4
with:
# cache: pnpm
node-version: 20
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store # -${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Create new branch
run: git checkout -b chore/auto-update-deps
- name: Install tools
run: npm i lerna npm-check-updates --no-save
- name: Update dependencies
run: npm run update
- name: Reinstall dependencies
run: npm run reinstall
- name: Commit changed files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add **/package.json pnpm-lock.yaml
git status
git commit -m "chore: auto dependency update"
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'chore/auto-update-deps'
force: true
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI-Pipeline

on:
pull_request:
push:
branches:
- 'develop'
- 'main'
- 'release/*'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

# - uses: pnpm/action-setup@v3
# with:
# run_install: false
# version: 8
# - uses: actions/setup-node@v4
# with:
# cache: pnpm
# node-version: 20

# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Install Node.js
uses: actions/setup-node@v4
with:
# cache: pnpm
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v3
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install
run: pnpm i
- name: Unused
run: pnpm -r unused
- name: Format
run: pnpm -r format
- name: Build
run: pnpm -r build
- name: Lint
run: pnpm -r lint
- name: Test
run: pnpm test # https://pnpm.io/configuring

- uses: actions/upload-artifact@v4
if: failure()
name: Upload theme test reports
with:
name: reports
path: |
packages/themes/**/test-results/**/*.png
!**/node_modules
40 changes: 40 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'CLA Assistant'

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
cla:
if: github.repository == 'public-ui/kolibri-demo-theme'
runs-on: ubuntu-latest
steps:
- name: 'CLA Assistant'
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Beta Release
uses: contributor-assistant/github-action@v2.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
path-to-signatures: 'cla/kolibri/signatures-v1.0.json'
path-to-document: 'https://github.com/public-ui/kolibri/blob/main/docs/CLA.md' # e.g. a CLA or a DCO document
remote-organization-name: 'public-ui'
remote-repository-name: '.github-private'
# branch should not be protected
branch: 'main'
allowlist: actions-user,bot*

#below are the optional inputs - If the optional inputs are not given, then default values will be taken
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
#use-dco-flag: true - If you are using DCO instead of CLA
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'

on:
push:
branches: ['develop', 'main', 'release/*']
pull_request:
# The branches below must be a subset of the branches above
branches: ['develop']
schedule:
- cron: '23 1 * * 6'

jobs:
analyze:
if: github.repository == 'public-ui/kolibri-demo-theme'
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript-typescript']
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
21 changes: 21 additions & 0 deletions .github/workflows/dod-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Definition of Done
on:
pull_request:
types: [opened, edited]


concurrency:
group: ci-{{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
check-dod:
runs-on: ubuntu-20.04
steps:
- name: Clone Repo
uses: actions/checkout@v3
- name: Check DoD
uses: platisd/definition-of-done@master
with:
dod_yaml: '.github/dod.yml'
github_token: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @see https://github.com/actions/stale

name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'

jobs:
stale:
if: github.repository == 'public-ui/kolibri-demo-theme'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
days-before-stale: 170
days-before-close: 10
days-before-pr-close: -1 # Don't close PR's
stale-issue-message: 'This issue has been automatically marked as stale and will be closed in 10 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, please post a comment or remove the Stale label.'
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity and is much likely outdated. If you think this PR is still relevant and applicable, please post a comment or remove the Stale label.'
close-issue-message: 'This issue was closed because it has been stale for 10 days with no activity. If the issue is still relevant to you, feel free to re-open with a comment.'
Loading

0 comments on commit 195fcb7

Please sign in to comment.