-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEVEX-117] Add js_code_review reusable workflow (#13)
- Loading branch information
1 parent
8c3adcc
commit 44d30b9
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "Code Review" | ||
|
||
on: | ||
workflow_call: {} | ||
|
||
jobs: | ||
js_code_review: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
|
||
# Corepack is an official tool by Node.js that manages package managers versions | ||
- name: Setup yarn | ||
run: corepack enable | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
node-version-file: ".node-version" | ||
cache: "yarn" | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Setup turbo cache | ||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | ||
with: | ||
path: node_modules/.cache/turbo | ||
key: ${{ runner.os }}-turbo-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-turbo- | ||
# The code-review script must be defined in the root workspace | ||
# Example: "turbo run typecheck format:check lint:check //#test:coverage" | ||
# See https://github.com/pagopa/io-fims/pull/41 | ||
- name: Run code-review script | ||
run: yarn run code-review | ||
|
||
# Codecov provides reports and metrics about test coverage data. | ||
# To enable set CODECOV_TOKEN secret at repo level and make sure | ||
# that your "code-review" script creates a "coverage/" folder in | ||
# the root workspace. | ||
- name: Upload coverage report to codecov.io | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
if: ${{ env.CODECOV_TOKEN != '' }} | ||
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0 | ||
with: | ||
token: ${{ env.CODECOV_TOKEN }} |