-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (55 loc) · 1.65 KB
/
Copy pathtest.yml
File metadata and controls
65 lines (55 loc) · 1.65 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
name: Test
on:
push:
branches:
- master
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v7
# No real key: `--version` and `zip` never reach the API.
- name: Install only
uses: ./
with:
token: not-a-real-key
install-only: true
- name: The CLI and its key are available to later steps
run: |
squarecloud --version
test "$SQUARECLOUD_API_KEY" = not-a-real-key
- name: Sample project
run: |
mkdir -p sample/src sample/node_modules/dep
echo "console.log('hi')" > sample/src/index.js
echo "{}" > sample/package-lock.json
echo "module.exports = 1" > sample/node_modules/dep/index.js
printf 'MAIN=src/index.js\nMEMORY=256\n' > sample/squarecloud.app
- name: Run a command in a folder, pinned version
uses: ./
with:
token: not-a-real-key
version: 3.1.0
command: zip
workdir: sample
- name: The zip leaves out node_modules and the lockfile
run: |
$(command -v python || command -v python3) -m zipfile -l sample/sample.zip | tee listing.txt
grep -q "src/index.js" listing.txt
! grep -q -e node_modules -e package-lock.json listing.txt