Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(action,docs): update workflow, badge #208

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 6 additions & 32 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
name: Build
on:
push:
branches: [ master, main ]
branches: [ main ]
pull_request:
branches: [ master, main, build, development ]
env:
COV_NODE_VERSION: 14
COV_NODE_VERSION: 16

jobs:
Integration-checks:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Set Node.js packages yarn cache directory
id: yarn-cache-dir
run: echo ::set-output name=CACHE_DIR::$(yarn cache dir)
- name: Node.js yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir.outputs.CACHE_DIR }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
cache: yarn
- name: Node.js modules cache
uses: actions/cache@v3
id: modules-cache
Expand All @@ -41,26 +31,10 @@ jobs:
if: ${{ steps.modules-cache.outputs.cache-hit != 'true' }}
run: yarn install
- name: Lint and test
uses: actions/github-script@v6
with:
script: |
const { execSync } = require('child_process');
try {
console.log(`${execSync('yarn test', { stdio: 'pipe' })}`);
} catch ({ stdout, stderr }) {
core.setFailed(`${stdout}\n${stderr}`);
}
run: yarn test
- name: Code coverage
if: ${{ success() && contains(matrix.node-version, env.COV_NODE_VERSION) }}
uses: codecov/[email protected]
- name: Confirm integration
if: ${{ success() }}
uses: actions/github-script@v6
with:
script: |
const { execSync } = require('child_process');
try {
console.log(`${execSync('yarn test:integration', { stdio: 'pipe' })}`);
} catch ({ stdout, stderr }) {
core.setFailed(`${stdout}\n${stderr}`);
}
run: yarn test:integration
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Apidoc Mock
[![Build Status](https://github.com/cdcabrera/apidoc-mock/workflows/Build/badge.svg?branch=master)](https://github.com/cdcabrera/apidoc-mock/actions?query=workflow%3ABuild)
[![Build Status](https://github.com/cdcabrera/apidoc-mock/workflows/Build/badge.svg?branch=main)](https://github.com/cdcabrera/apidoc-mock/actions?query=workflow%3ABuild)
[![codecov](https://codecov.io/gh/cdcabrera/apidoc-mock/branch/master/graph/badge.svg)](https://codecov.io/gh/cdcabrera/apidoc-mock)
[![Docker Repository on Quay](https://quay.io/repository/cdcabrera/apidoc-mock/status "Docker Repository on Quay")](https://quay.io/repository/cdcabrera/apidoc-mock)
[![License](https://img.shields.io/github/license/cdcabrera/apidoc-mock.svg)](https://github.com/cdcabrera/apidoc-mock/blob/master/LICENSE)
Expand Down