-
-
Notifications
You must be signed in to change notification settings - Fork 294
90 lines (77 loc) · 3.41 KB
/
FrontendTest.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
83
84
85
86
87
88
89
90
name: Chrome frontend tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
paths-ignore:
- "**.md"
branches:
- main
- release
pull_request:
paths-ignore:
- "**.md"
branches-ignore:
- release
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
frontend-test:
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Makes thes `julia` command available
- uses: julia-actions/setup-julia@v2
with:
version: "1.10" # our lowest supported version
- name: Install Pluto.jl packages
run: |
julia --project=$GITHUB_WORKSPACE -e "using Pkg; Pkg.instantiate()"
- uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: Install Chrome dependencies
run: |
sudo apt-get update
# See https://crbug.com/795759
sudo apt-get install -yq libgconf-2-4
# Install latest chrome dev package, which installs the necessary libs to
# make the bundled version of Chromium that Puppeteer installs work.
sudo apt-get install -y wget --no-install-recommends
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install -y google-chrome-stable --no-install-recommends
sudo rm -rf /var/lib/apt/lists/*
- name: Install dependencies
working-directory: ./test/frontend
run: |
npm install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable"
- name: Run tests
working-directory: ./test/frontend
run: |
julia --project=$GITHUB_WORKSPACE -e 'import Pluto
# Run Pluto.jl server in the background
options = Pluto.Configuration.from_flat_kwargs(;
port=parse(Int, ENV["PLUTO_PORT"]),
require_secret_for_access=false,
workspace_use_distributed_stdlib=false,
)
🍭 = Pluto.ServerSession(; options)
server = Pluto.run!(🍭)
run(`npm run test`)
close(server)'
env:
PLUTO_PORT: 1235
PLUTO_TEST_OFFLINE: ${{ github.ref_name == 'release' }}
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable"
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-screenshot-artifacts
path: ${{ github.workspace }}/test/frontend/artifacts/*.png