138 lines (123 loc) · 3.93 KB
/
install.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Workflow for testing installation of various products
#
# Triggered after a release and performed on separate VMs to the
# build so as to test independence from repo checkout and build dependencies.
#
# The intent of this workflow is to quickly identify any issues with
# releases so that a new release can be made if necessary.
name: Install
on:
# Allow this workflow to be triggered by the `release.yml` workflow
# or manually at https://github.com/stencila/stencila/actions/workflows/install.yml
workflow_dispatch:
inputs:
cli:
description: Install CLI
type: boolean
default: true
docker:
description: Run Docker image
type: boolean
default: true
node:
description: Install Node SDK
type: boolean
default: true
python:
description: Install Python SDK
type: boolean
default: true
jobs:
cli:
if: ${{ inputs.cli }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Install CLI
run: curl --proto '=https' --tlsv1.2 -sSf https://stencila.dev/install.sh | sh
- name: Run CLI
run: stencila --help
docker:
if: ${{ inputs.docker }}
runs-on: ubuntu-latest
steps:
- name: Pull image
run: docker pull stencila/stencila
- name: Run image
run: docker run --rm stencila/stencila --help
node:
if: ${{ inputs.node }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- buildjet-2vcpu-ubuntu-2204-arm
- macos-latest # x64
- macos-latest-xlarge # arm64
- windows-latest
version:
- 18
- 20
runs-on: ${{ matrix.os }}
steps:
- name: Setup Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
registry-url: "https://registry.npmjs.org"
- name: Install package using NPM
run: npm install @stencila/node && npm rm @stencila/node
- name: Install package using Yarn
run: yarn add @stencila/node
- name: Use package as a CJS module
# Use outer double quotes to avoid issues within inner double quotes on Windows
run: node -e "const stencila = require('@stencila/node'); console.log(stencila)"
- name: Use package as a ESM module using `ts-node`
run: |
echo "import stencila from '@stencila/node'; console.log(stencila)" > test.ts
npx ts-node test.ts
python:
if: ${{ inputs.python }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-latest
- macos-latest # x64
- macos-latest-xlarge # arm64
- windows-latest
version:
# These must be strings to avoid rounding down e.g. 3.10 -> 3.1
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
# These combinations are not supported by GitHub Actions
# For versions supported see: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- os: macos-latest-xlarge
version: "3.8"
- os: macos-latest-xlarge
version: "3.9"
- os: macos-latest-xlarge
version: "3.10"
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: Install package
run: python3 -m pip install stencila
- name: Use package
# Use outer double quotes to avoid issues within inner double quotes on Windows
# Imports everything from main modules to check from import errors (e.g. missing dependencies)
run: python3 -c "from stencila.types import *; from stencila.convert import *"