mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 19:04:38 +00:00
Merge pull request #14872 from strapi/chore/update-codecov-gh-action
This commit is contained in:
commit
e033275bd0
7
.github/actions/install-modules/action.yml
vendored
7
.github/actions/install-modules/action.yml
vendored
@ -1,12 +1,7 @@
|
||||
name: 'Install modules'
|
||||
description: 'Run yarn install and add global modules'
|
||||
inputs:
|
||||
globalPackages:
|
||||
description: 'Global packages to install'
|
||||
description: 'Install yarn dependencies'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- run: $GITHUB_ACTION_PATH/script.sh
|
||||
env:
|
||||
GLOBAL_PACKAGES: ${{ inputs.globalPackages }}
|
||||
shell: bash
|
||||
|
||||
6
.github/actions/install-modules/script.sh
vendored
6
.github/actions/install-modules/script.sh
vendored
@ -1,8 +1,2 @@
|
||||
# install global packages if set
|
||||
if [[ -n "$GLOBAL_PACKAGES" ]]; then
|
||||
yarn global add "$GLOBAL_PACKAGES"
|
||||
yarn global bin >>$GITHUB_PATH
|
||||
fi
|
||||
|
||||
# run yarn
|
||||
yarn
|
||||
|
||||
24
.github/workflows/tests.yml
vendored
24
.github/workflows/tests.yml
vendored
@ -34,8 +34,6 @@ jobs:
|
||||
name: 'unit_back (node: ${{ matrix.node }})'
|
||||
needs: [lint]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.codecov }}
|
||||
strategy:
|
||||
matrix:
|
||||
node: [14, 16, 18]
|
||||
@ -46,17 +44,19 @@ jobs:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: yarn
|
||||
- uses: ./.github/actions/install-modules
|
||||
with:
|
||||
globalPackages: codecov
|
||||
- name: Run tests
|
||||
run: yarn run -s test:unit --coverage && codecov -C -F unit
|
||||
run: yarn run -s test:unit --coverage
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./coverage
|
||||
flags: back,unit_back
|
||||
|
||||
unit_front:
|
||||
name: 'unit_front (node: ${{ matrix.node }})'
|
||||
needs: [lint]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.codecov }}
|
||||
strategy:
|
||||
matrix:
|
||||
node: [14, 16, 18]
|
||||
@ -67,12 +67,16 @@ jobs:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: yarn
|
||||
- uses: ./.github/actions/install-modules
|
||||
with:
|
||||
globalPackages: codecov
|
||||
- name: Build
|
||||
run: yarn build
|
||||
- name: Run test
|
||||
run: yarn run -s test:front --coverage && codecov -C -F front
|
||||
run: yarn run -s test:front --coverage
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./coverage
|
||||
flags: front,unit_front
|
||||
|
||||
api_ce_pg:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
coverageDirectory: '<rootDir>/coverage',
|
||||
projects: ['<rootDir>/packages/**/jest.config.js', '<rootDir>/.github'],
|
||||
};
|
||||
|
||||
@ -8,5 +8,4 @@ module.exports = {
|
||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
||||
roots: [__dirname],
|
||||
collectCoverageFrom: ['<rootDir>/packages/core/admin/admin/**/*.js'],
|
||||
coverageDirectory: '<rootDir>/packages/core/admin/coverage',
|
||||
};
|
||||
|
||||
@ -6,5 +6,4 @@ module.exports = {
|
||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
||||
roots: [__dirname],
|
||||
collectCoverageFrom: ['<rootDir>/packages/core/helper-plugin/lib/src/**/*.js'],
|
||||
coverageDirectory: '<rootDir>/packages/core/helper-plugin/coverage',
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user