Skip to content

Commit

Permalink
chore: streamline ci setup
Browse files Browse the repository at this point in the history
  • Loading branch information
boredland authored and manast committed Aug 14, 2022
1 parent 19c0da8 commit 3b060fa
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 144 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [lts/*]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: yarn install
run: |
yarn install
Expand All @@ -26,7 +27,7 @@ jobs:
env:
CI: true
- name: deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # tag=v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ master, next ]
branches: [master, next]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '29 16 * * 5'

Expand All @@ -32,39 +32,39 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=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
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 # tag=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.
# 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
# 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@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 # tag=v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ 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
# ✏️ 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
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 # tag=v2
43 changes: 0 additions & 43 deletions .github/workflows/coverage.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/node.js.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: 14
node-version: lts/*
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
- name: Release
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js Tests

on:
push:
branches: [master]
pull_request:
branches: [master, next]

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

jobs:
coverage:
runs-on: ubuntu-latest

name: coverage for node@lts, redis@7
env:
node-version: lts/*
redis-version: 7-alpine

steps:
- name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node.js
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
- name: Start Redis
uses: supercharge/redis-github-action@4b67a313c69bc7a90f162e8d810392fffe10d3b5 # tag=1.4.0
with:
redis-version: ${{ env.redis-version }}
- run: yarn install --frozen-lockfile --non-interactive
- run: yarn build
- run: yarn coverage
- name: Coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: yarn coveralls

compatibility:
runs-on: ubuntu-latest

name: testing node@${{ matrix.node-version }}, redis@${{ matrix.redis-version }}

strategy:
matrix:
node-version: [lts/*, lts/-1, lts/-2, current]
redis-version: [7-alpine]
include:
- node-version: 'lts/*'
redis-version: 5-alpine
- node-version: 'lts/*'
redis-version: 6-alpine

steps:
- name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Start Redis
uses: supercharge/redis-github-action@4b67a313c69bc7a90f162e8d810392fffe10d3b5 # tag=1.4.0
with:
redis-version: ${{ matrix.redis-version }}
- run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- run: yarn build
- run: yarn test
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.2'
services:
redis:
image: redis
image: redis:7-alpine
container_name: cache
ports:
- 6379:6379
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"eslint:fix": "./node_modules/.bin/eslint . --ignore-path ./.eslintignore --fix",
"lint": "./node_modules/.bin/eslint . --ignore-path ./.eslintignore",
"lint:staged": "lint-staged",
"prepare": "yarn build",
"prepublishOnly": "yarn build",
"generate:raw:scripts": "ts-node --project tsconfig-cjs.json generateRawScripts.ts",
"prettier": "prettier --config package.json src/**/*.ts",
"pretty:quick": "pretty-quick --ignore-path ./.eslintignore --staged",
Expand Down

0 comments on commit 3b060fa

Please sign in to comment.