-
Notifications
You must be signed in to change notification settings - Fork 14
82 lines (71 loc) · 3.04 KB
/
external-api-test.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
76
77
78
79
80
81
82
# This workflow will check if no regression is introduced in externals API
name: 'External API check'
on:
workflow_dispatch:
# Check twice a day at 5:00 AM and 3:00 PM
schedule:
- cron: '0 5,15 * * *'
# Be extremely careful as the env variables defined here are accessible by all the actions of the workflow.
# For critical env variable, declare it within the action.
env:
node-version: 18.x
INSEE_CLIENT_ID: ${{ secrets.INSEE_CLIENT_ID }}
INSEE_CLIENT_SECRET: ${{ secrets.INSEE_CLIENT_SECRET}}
INSEE_CLIENT_ID_FALLBACK: ${{ secrets.INSEE_CLIENT_ID_FALLBACK }}
INSEE_CLIENT_SECRET_FALLBACK: ${{ secrets.INSEE_CLIENT_SECRET_FALLBACK}}
NEXT_PUBLIC_END2END_MOCKING: disabled
INSEE_ENABLED: enabled
INDEXING_ENABLED: enabled
REDIS_ENABLED: disabled
PROXY_API_KEY: ${{ secrets.PROXY_API_KEY }}
MONCOMPTEPRO_CLIENT_ID: ${{ secrets.MONCOMPTEPRO_CLIENT_ID }}
MONCOMPTEPRO_CLIENT_SECRET: ${{ secrets.MONCOMPTEPRO_CLIENT_SECRET }}
MONCOMPTEPRO_URL: ${{ secrets.MONCOMPTEPRO_URL }}
MONCOMPTEPRO_REDIRECT_URI: ${{ secrets.MONCOMPTEPRO_REDIRECT_URI }}
MONCOMPTEPRO_POST_LOGOUT_REDIRECT_URI: ${{ secrets.MONCOMPTEPRO_POST_LOGOUT_REDIRECT_URI }}
IRON_SESSION_PWD: ${{ secrets.IRON_SESSION_PWD }}
jobs:
dependencies:
name: 'Install dependencies'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- uses: ./.github/actions/install-dependencies
name: Install and cache dependencies
testExternalAPIs:
name: Test externals API
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Load node_modules
uses: ./.github/actions/load-dependencies
- name: Run API client unit tests
run: |
npm run test:api-clients:update-snapshots -- --runInBand --testTimeout=61000 --silent
- name: 'Create a PR if there is a diff in the snapshots'
uses: peter-evans/create-pull-request@v5
with:
branch: 'BOT-snapshots-update'
title: '🤖 API client snapshots update'
commit-message: 'test: update API clients snapshots'
body: |
*This PR is automatically generated by a bot.*
It updates the snapshots of the API clients.
Review carefully the changes to see if there is no regression:
- No changes in attributes names
- No suspect massive changes in the data
- No changes in the structure of the data
If everything looks good, you can merge this PR.
Otherwise, you should take action to fix the issue, by either:
- Contact the administration responsible for the API
- Change the client code to adapt to the new data
token: ${{ secrets.TOKEN_GITHUB_EXTERNAL_API_TEST_PR }}