-
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 1.71 KB
/
Copy pathtest.yml
File metadata and controls
70 lines (57 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Yarn Install and Test
on:
push:
branches:
- "**"
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- uses: actions/checkout@v4
# Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org/"
# Enable Corepack and use the correct Yarn version
- name: Enable Corepack
run: corepack enable
- name: Use the correct Yarn version
run: corepack prepare yarn@3.6.3 --activate
# Load .env file if exists
- name: Load .env file if exists
run: |
if [ -f .env ]; then
set -a
source .env
set +a
fi
# Set Environment Variables with fallback to .env
- name: Set Environment Variables with fallback to .env
run: |
echo "NPM_READ_TOKEN=${{ secrets.NPM_READ_TOKEN || env.NPM_READ_TOKEN }}" >> $GITHUB_ENV
# Install dependencies
- name: Install dependencies
run: yarn install
# Run lint
- name: Run lint
run: yarn lint
# Run tests with coverage
- name: Run tests with coverage
run: yarn test --coverage
# Archive coverage reports (fixed version)
- name: Archive coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage
# Upload coverage to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false