Skip to content

Commit

Permalink
🎉 Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidRobertAnsart committed Jan 7, 2021
1 parent 99d671c commit a34360b
Show file tree
Hide file tree
Showing 14 changed files with 966 additions and 44 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Workflow that build the project.
name: Build

# Triggered on every branch at every push
on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.yarn/cache
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: yarn
- name: Run build
run: yarn build
85 changes: 85 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: "44 17 * * 1"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

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

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

# build javascript files
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.yarn/cache
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: yarn
- name: Run build
run: yarn build:server

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
61 changes: 61 additions & 0 deletions .github/workflows/fix-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: FixDependabot

on:
push:
branches: [dependabot/npm_and_yarn/**]

jobs:
build:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
persist-credentials: false # minimize exposure
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: "12"
- name: Autofix lockfile
run: |
# change directory
# assuming Angular commit style (build: bump XXX from AAA to BBB in YYY)
# use $8 for default commit message style (Bump XXX from AAA to BBB in YYY)
cd .`git log -1 --pretty=%s | awk '{ print $9 }'`
# restore yarn.lock from the previous commit
git checkout HEAD^ -- yarn.lock
# install yarn-plugin-deduplicate
yarn plugin import https://raw.githubusercontent.com/eps1lon/yarn-plugin-deduplicate/latest/bin/%40yarnpkg/plugin-deduplicate.js
# if package.json was not updated, upgrade the dependency
# assuming Angular commit style (build: bump XXX from ...)
# use $2 for default commit message style (Bump XXX from ...)
git diff --name-only HEAD^ HEAD | grep -q 'package.json' || yarn up `git log -1 --pretty=%s | awk '{ print $3 }'`
# restore package.json from the last commit
git checkout HEAD -- package.json
yarn install
# deduplicate lockfile
yarn deduplicate
env:
YARN_ENABLE_SCRIPTS: 0 # disable postinstall scripts
- name: Config Git
run: |
# use personal access token to allow triggering new workflow
BASIC_AUTH=$(echo -n "x-access-token:${{ secrets.GH_TOKEN }}" | base64)
echo "::add-mask::$BASIC_AUTH"
git config --global user.name '${{ github.event.commits[0].author.name }}'
git config --global user.email '${{ github.event.commits[0].author.email }}'
git config --local http.$GITHUB_SERVER_URL/.extraheader "AUTHORIZATION: basic $BASIC_AUTH"
- name: Commit changes
run: |
cd .`git log -1 --pretty=%s | awk '{ print $9 }'` # ditto
git add yarn.lock # only add yarn.lock if not using zero-installs
git commit -m "Dependabot autofix"
git push
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Workflow that lint and build with typescript the code.
name: ESLint & Typescript

# Triggered on very branch at every push
on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.yarn/cache
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: yarn
- name: Run tests
run: yarn test
Loading

0 comments on commit a34360b

Please sign in to comment.