-
Notifications
You must be signed in to change notification settings - Fork 14
82 lines (71 loc) · 2.58 KB
/
integration.yml
File metadata and controls
82 lines (71 loc) · 2.58 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Integration Test
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install MetaCall Unix (Debug)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh -s -- --debug
- name: Install MetaCall Windows
if: matrix.os == 'windows-latest'
run: powershell -NoProfile -ExecutionPolicy Unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1')))"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build
run: cargo build
- name: Integration Testing
working-directory: ./tests/web-app
shell: bash
env:
npm_config_script_shell: bash
run: |
npm install
npm run build:debug
npm run start:debug &
sleep 10
response=$(curl --write-out "%{http_code}" --silent --output /dev/null http://localhost:8080)
if [ "$response" -ne 200 ]; then
echo "Server did not respond with status 200"
exit 1
fi
exit 0
# TODO: Improve testing by checking if resulting HTML is correct
# - name: Install Playwright
# run: npm install -g playwright
# - name: Run Playwright test
# run: |
# node -e "
# const { chromium } = require('playwright');
# (async () => {
# const browser = await chromium.launch();
# const page = await browser.newPage();
# await page.goto('http://localhost:3000');
# const html = await page.content();
# if (!html.includes('<title>My Node App</title>')) {
# console.error('HTML content did not match expected value');
# process.exit(1);
# }
# await browser.close();
# })();
# "