Skip to content

Commit

Permalink
ci: build system (#42)
Browse files Browse the repository at this point in the history
* 👷

Signed-off-by: Hiro <[email protected]>

Took 4 minutes

* 👷 ci build.y

Signed-off-by: Hiro <[email protected]>

Took 4 minutes

* 👷 chore

Signed-off-by: Hiro <[email protected]>

Took 4 minutes

* 👷 ci fix build

Signed-off-by: Hiro <[email protected]>

Took 5 minutes

* 👷 ci jest

Signed-off-by: Hiro <[email protected]>

Took 14 minutes

* 👷 try build

Signed-off-by: Hiro <[email protected]>

Took 3 minutes

* 👷

Signed-off-by: Hiro <[email protected]>

Took 4 minutes


Took 2 minutes

* 👷 ci build.y

Signed-off-by: Hiro <[email protected]>

Took 4 minutes

* 👷 chore

Signed-off-by: Hiro <[email protected]>

Took 4 minutes

* 👷 ci fix build

Signed-off-by: Hiro <[email protected]>

Took 5 minutes


Took 20 seconds

* 🔀 main

Signed-off-by: Hiro <[email protected]>

Took 1 minute

* 👷 try build

Signed-off-by: Hiro <[email protected]>

Took 3 minutes


Took 37 seconds

* fix: pnpm lock

Signed-off-by: Hiro <[email protected]>

Took 3 minutes

* 💚

Signed-off-by: Hiro <[email protected]>

Took 13 seconds

* 💚 cross

Signed-off-by: Hiro <[email protected]>

Took 1 minute

* 💚 restrict cross to pull_requst

Signed-off-by: Hiro <[email protected]>

Took 6 minutes

* 💚 failfast true

Signed-off-by: Hiro <[email protected]>

Took 2 minutes

* 💚 fix cross

Signed-off-by: Hiro <[email protected]>

Took 1 minute

* 💚 fix cross

Signed-off-by: Hiro <[email protected]>

Took 3 minutes

* 💚 cross, disable arm

Signed-off-by: Hiro <[email protected]>

Took 3 minutes

* 💚 cross, disable arm64

Signed-off-by: Hiro <[email protected]>

Took 2 minutes
  • Loading branch information
Hiro authored Oct 13, 2023
1 parent e245239 commit 79a7837
Show file tree
Hide file tree
Showing 9 changed files with 4,861 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [Nasfame]
33 changes: 33 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Related Issue(s)

Fixes #
<br>
For #

## Proposed Changes

[//]: # '[List down the specific changes you have made in this pull request.]'

- [x]

## Checklist

- [x] I have followed the repository's contribution guidelines.
- [x] I have added necessary documentation or updated existing documentation.
- [x] My code follows the established code style and formatting of the project.
- [x] I have tested my changes and they function as expected.
- [ ] I have added suitable unit tests (if applicable).

## Screenshots

<!--[Please upload screenshots of the affected screens]-->

## To-Do

<!-- [If there are any pending tasks or follow-ups, list them here.] -->

- [ ]

## Additional Information

<!--[Include any additional information that may be relevant, such as screenshots, GIFs, or links to external resources.]-->
39 changes: 39 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build

on:
push:
branches:
tags:
pull_request:
branches:

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8.6.6

- name: Set up Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: 19.9.0 #last release of node v19
check-latest: false

- name: Install dependencies
run: pnpm install

- name: Build
run: |
npm run build
81 changes: 81 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# 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: ['main']
pull_request:
# The branches below must be a subset of the branches above
branches: ['main']
schedule:
- cron: '25 10 * * 4'

jobs:
analyze:
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']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' 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@v2
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@v2

# ℹ️ 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@v2
with:
category: '/language:${{matrix.language}}'
58 changes: 58 additions & 0 deletions .github/workflows/cross.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Cross

on:
push:
branches:
- main
tags:

pull_request:
branches:

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
MODE: test
NODE_ENV: testing

jobs:
build:
timeout-minutes: 10

strategy:
max-parallel: 2
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node_version: [18, 19, 20]
architecture: [x64]#, arm64 ] # arm,

runs-on: ${{ matrix.os }}
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8.6.6

- uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
check-latest: true

- name: Install dependencies
run: pnpm install

- name: Build
run: npm run build

- name: Run tests for ${{runner.os}}
run: npm run test
46 changes: 46 additions & 0 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Prettier

on:
# pull_request:
push:
branches: [main]

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: write
contents: write

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
persist-credentials: true

- name: Git config
run: |
git config user.name Nasfame
git config user.email [email protected]
- name: Prettify code
uses: creyD/[email protected]
with:
dry: false
github_token: ${{ github.token }}
same_commit: false
commit_message: 'style: pretty code'
commit_description: 'automated via ci'
file_pattern: '*'
only_changed: false
prettier_options: '--write .'
# prettier_plugins

12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 90,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "always",
"proseWrap": "always"
}
28 changes: 25 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "web",
"name": "decenterai.com",
"version": "0.1.0",
"description": "Decenter AI landing page: www.decenterai.com",
"author": "[email protected]",
"license": "MIT",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@types/node": "20.6.2",
Expand All @@ -29,5 +33,23 @@
"tailwindcss": "3.3.3",
"ts-jest": "^29.1.1",
"typescript": "5.2.2"
}
},
"devDependencies": {
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=6.0.0",
"pnpm": ">=8.6.6"
},
"repository": {
"type": "git",
"url": "https://github.com/Decenter-AI/decenterai.com.git"
},
"bugs": {
"url": "https://github.com/Decenter-AI/decenterai.com/issues"
},
"homepage": "https://decenterai.com"
}
Loading

1 comment on commit 79a7837

@vercel
Copy link

@vercel vercel bot commented on 79a7837 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.