|
11 | 11 | - "**" |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - lint: |
15 | | - runs-on: ubuntu-latest |
16 | | - steps: |
17 | | - - name: Checkout |
18 | | - uses: actions/checkout@v4 |
19 | | - |
20 | | - - name: Cache dependencies |
21 | | - uses: actions/setup-node@v4 |
22 | | - with: |
23 | | - node-version: 16 |
24 | | - cache: "yarn" |
25 | | - registry-url: "https://npm.pkg.github.com" |
26 | | - # Defaults to the user or organization that owns the workflow file |
27 | | - scope: "@RaspberryPiFoundation" |
28 | | - |
29 | | - - name: Install code |
30 | | - run: yarn install --immutable |
31 | | - env: |
32 | | - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
33 | | - |
34 | | - - name: eslint |
35 | | - run: yarn lint |
36 | | - |
37 | | - # - name: stylelint |
38 | | - # run: yarn stylelint |
39 | | - |
40 | | - test: |
41 | | - runs-on: ubuntu-latest |
42 | | - steps: |
43 | | - - name: Checkout |
44 | | - uses: actions/checkout@v1 |
45 | | - |
46 | | - - name: Cache dependencies |
47 | | - uses: actions/setup-node@v4 |
48 | | - with: |
49 | | - node-version: 16 |
50 | | - cache: "yarn" |
51 | | - registry-url: "https://npm.pkg.github.com" |
52 | | - # Defaults to the user or organization that owns the workflow file |
53 | | - scope: "@RaspberryPiFoundation" |
54 | | - |
55 | | - - name: Install code |
56 | | - run: yarn install --immutable |
57 | | - env: |
58 | | - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
59 | | - |
60 | | - - name: Run tests |
61 | | - run: yarn run test --coverage --maxWorkers=4 --workerThreads=true --reporters=default --reporters=jest-junit --reporters=jest-github-actions-reporter |
62 | | - env: |
63 | | - JEST_JUNIT_OUTPUT_DIR: ./coverage/ |
64 | | - REACT_APP_API_ENDPOINT: http://localhost:3009 |
65 | | - - name: Record coverage |
66 | | - run: ./.github/workflows/record_coverage |
67 | | - env: |
68 | | - GITHUB_TOKEN: ${{ github.token }} |
69 | | - |
70 | | - test-cypress: |
71 | | - runs-on: ubuntu-latest |
72 | | - steps: |
73 | | - - name: Checkout |
74 | | - uses: actions/checkout@v1 |
75 | | - |
76 | | - - name: Cache dependencies |
77 | | - uses: actions/setup-node@v4 |
78 | | - with: |
79 | | - node-version: 16 |
80 | | - cache: "yarn" |
81 | | - registry-url: "https://npm.pkg.github.com" |
82 | | - # Defaults to the user or organization that owns the workflow file |
83 | | - scope: "@RaspberryPiFoundation" |
84 | | - |
85 | | - - name: Install code |
86 | | - run: yarn install --immutable |
87 | | - env: |
88 | | - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
89 | | - |
90 | | - - name: Cypress run |
91 | | - uses: cypress-io/github-action@v6 |
92 | | - with: |
93 | | - install: false |
94 | | - start: | |
95 | | - yarn start |
96 | | - wait-on: "http://localhost:3011" |
97 | | - quiet: true |
98 | | - config-file: cypress.config.mjs |
99 | | - browser: chrome |
100 | | - env: |
101 | | - REACT_APP_API_ENDPOINT: "https://test-editor-api.raspberrypi.org" |
102 | | - PUBLIC_URL: "http://localhost:3011" |
103 | | - ASSETS_URL: "http://localhost:3011" |
104 | | - REACT_APP_PLAUSIBLE_SOURCE: "" |
105 | | - |
106 | | - - name: Archive cypress artifacts |
107 | | - uses: actions/upload-artifact@v3 |
108 | | - if: failure() |
109 | | - with: |
110 | | - name: cypress-artifacts |
111 | | - path: | |
112 | | - cypress/screenshots |
113 | | -
|
114 | | - deploy-tag: |
115 | | - if: github.ref_type == 'tag' |
116 | | - uses: ./.github/workflows/deploy.yml |
117 | | - with: |
118 | | - base_url: https://editor-static.raspberrypi.org |
119 | | - assets_url: https://editor-static.raspberrypi.org |
120 | | - environment: production |
121 | | - prefix: releases |
122 | | - react_app_api_endpoint: https://editor-api.raspberrypi.org |
123 | | - react_app_authentication_url: https://auth-v1.raspberrypi.org |
124 | | - react_app_base_url: "" |
125 | | - react_app_google_tag_manager_id: GTM-5FWFWFJ |
126 | | - react_app_plausible_data_domain: "editor.raspberrypi.org" |
127 | | - react_app_plausible_source: "https://plausible.io/js/script.js" |
128 | | - react_app_sentry_dsn: https://[email protected]/4504055099621376 |
129 | | - react_app_sentry_env: production |
130 | | - secrets: inherit |
131 | | - |
132 | | - deploy-main: |
133 | | - if: github.ref_type == 'branch' && github.ref_name == 'main' |
134 | | - uses: ./.github/workflows/deploy.yml |
135 | | - with: |
136 | | - environment: staging |
137 | | - react_app_base_url: "" |
138 | | - react_app_sentry_env: staging |
139 | | - secrets: inherit |
140 | | - |
141 | 14 | deploy-branch: |
142 | 15 | if: github.ref_type == 'branch' && github.ref_name != 'main' |
143 | 16 | uses: ./.github/workflows/deploy.yml |
|
0 commit comments