Skip to content

Commit

Permalink
chore(Pipeline): Add github action code
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Moving to VueJS 3
  • Loading branch information
Belphemur committed Mar 27, 2022
1 parent e3f9c31 commit 072aba6
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 40 deletions.
14 changes: 14 additions & 0 deletions .github/.kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Minimal config. version is the only required field.
version = 1
[merge]
automerge_label = "ship it!"

[merge.automerge_dependencies]
# auto merge all PRs opened by "dependabot" that are "minor" or "patch" version upgrades. "major" version upgrades will be ignored.
versions = ["minor", "patch"]
usernames = ["dependabot"]

# if using `update.always`, add dependabot to `update.ignore_usernames` to allow
# dependabot to update and close stale dependency upgrades.
[update]
ignored_usernames = ["dependabot"]
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
labels:
- "dependencies"
# Add Kodiak `merge.automerge_label`
- "ship it!"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
labels:
- "dependencies"
# Add Kodiak `merge.automerge_label`
- "ship it!"
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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, master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '23 12 * * 5'

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@v3

# 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

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
97 changes: 97 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: NodeJs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN }}
NODEJS: 16
YARN_CACHE: "yarn-cache"

on:
push:
branches: [ develop, master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop, master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14', '16' ]
steps:
- uses: actions/checkout@v3
- name: Set yarn cache
run: yarn config set cache-folder ${{env.YARN_CACHE}}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: yarn
with:
path: ${{env.YARN_CACHE}}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test
- name: Upload code coverage
uses: codecov/codecov-action@v2.1.0
with:
fail_ci_if_error: true # optional (default = false)
deploy-pages:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set yarn cache
run: yarn config set cache-folder ${{env.YARN_CACHE}}
- name: Setup Node.js
uses: actions/setup-node@v3.0.0
with:
node-version: ${{env.NODEJS}}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: yarn
with:
path: ${{env.YARN_CACHE}}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install semantic-release dependencies
run: yarn install --frozen-lockfile
- name: Build package
run: yarn build:example
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.

release:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set yarn cache
run: yarn config set cache-folder ${{env.YARN_CACHE}}
- name: Setup Node.js
uses: actions/setup-node@v3.0.0
with:
node-version: ${{env.NODEJS}}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: yarn
with:
path: ${{env.YARN_CACHE}}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install semantic-release dependencies
run: yarn install --frozen-lockfile
- name: Build package
run: yarn build
- name: Release
run: yarn semantic-release

37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"commitmsg": "validate-commit-msg",
"dev": "vite",
"semantic-release": "semantic-release",
"test": "jest"
"test": "jest",
"buid:example": "vite build"
},
"main": "dist/vue-json-csv.common.js",
"files": [
Expand Down
4 changes: 3 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ export default defineConfig({
},
root: 'example',
base: './',
publicDir: 'docs'
build: {
outDir: '../docs'
}
})
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7021,7 +7021,7 @@ humanize-ms@^1.2.1:
dependencies:
ms "^2.0.0"

husky@^7.0:
husky@^7.0.0:
version "7.0.4"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
Expand Down

0 comments on commit 072aba6

Please # to comment.