generated from mission-apprentissage/template-apprentissage
-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (62 loc) · 1.87 KB
/
yarn-ci-server.yml
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
71
72
73
74
75
# Worflow pour IC
name: Yarn CI Server
on: [push]
jobs:
# Single job
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'server'
steps:
# Checks-out the repository
- uses: actions/[email protected]
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
# setup .yarnrc.yml
- name: Create .yarnrc.yml
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn set version 3.3.1
yarn config set nodeLinker node-modules
yarn config set defaultSemverRangePrefix ""
yarn config set npmScopes.mission-apprentissage.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.mission-apprentissage.npmPublishRegistry "https://npm.pkg.github.com"
yarn config set npmScopes.mission-apprentissage.npmAlwaysAuth true
yarn config set npmScopes.mission-apprentissage.npmAuthToken $NPM_TOKEN
# Install dependencies
- name: Run Yarn Install
run: |
yarn install --immutable
# Lint
- name: Run Lint
run: |
yarn lint
# Start docker container for tests (e.g: mongodb)
- name: Start Docker
run: |
cp ../ui/.env.example ../ui/.env
cp .env.example .env
yarn docker:start-ci
# Run mocha tests
- name: Run Tests
run: |
yarn test:coverage
# codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage
name: codecov-server
verbose: true
# Teardown
- name: Teardown
run: |
yarn docker:down