-
Notifications
You must be signed in to change notification settings - Fork 358
68 lines (63 loc) · 1.96 KB
/
example-build-artifacts.yml
File metadata and controls
68 lines (63 loc) · 1.96 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
name: example-build-artifacts
# This workflow shows how to split build and test steps with artifacts.
# In the build job, dependencies are installed, the app is built and the build results
# are stored as an artifact using actions/upload-artifact.
# No tests are run in the build job.
# The test jobs use the results from the build job:
# - dependencies and the Cypress binary are installed using dependency caching
# - build results are restored using actions/download-artifact
#
# In the example jobs, the action is called with
# uses: ./
# which runs the action code from the current branch.
# If you copy this workflow to another repo, replace the line with
# uses: cypress-io/github-action@v7
on:
push:
branches:
- 'master'
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build app
uses: ./
with:
runTests: false # only build app, don't test yet
build: npm run build
working-directory: examples/nextjs
- name: Store build artifacts
uses: actions/upload-artifact@v7 # https://github.com/actions/upload-artifact
with:
name: app
path: examples/nextjs/build
if-no-files-found: error
retention-days: 1
test:
needs: build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- windows-2025
- macos-26
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Restore build artifacts
uses: actions/download-artifact@v8 # https://github.com/actions/download-artifact
with:
name: app
path: examples/nextjs/build
- name: Cypress tests
uses: ./
with:
start: npm start # start server using the build artifacts
wait-on: http://localhost:3000
working-directory: examples/nextjs