Refactoring & Documenting the project #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MetaCall Examples CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
env: | |
pythonVersion: 3.12 | |
nodeVersion: 20 | |
jobs: | |
test: | |
name: Test ${{ matrix.env }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
env: [cli, faas] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.pythonVersion }} | |
- name: Install MetaCall (CLI only - Ubuntu) | |
if: matrix.env == 'cli' && matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt update | |
curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh | |
metacall | |
- name: Install MetaCall (CLI only - Windows) | |
if: matrix.env == 'cli' && 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')))" | |
echo C:\Users\runneradmin\AppData\Local\MetaCall >> $env:GITHUB_PATH | |
shell: powershell | |
- name: Set up Node.js | |
if: matrix.env == 'faas' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.nodeVersion }} | |
- name: Install MetaCall Deploy and FaaS (FaaS only) | |
if: matrix.env == 'faas' | |
run: | | |
npm i -g @metacall/deploy @metacall/faas | |
metacall-deploy --version | |
metacall-faas --version | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Start FaaS Service | |
if: matrix.env == 'faas' && matrix.os == 'ubuntu-latest' | |
run: | | |
docker run -d -p 9000:9000 --name faas_container metacall/faas | |
- name: Run Test Suits | |
run: | | |
if [ "${{ matrix.env }}" == "faas" && "${{ matrix.os }}" == "windows-latest" ]; then | |
metacall-faas & | |
sleep 5 # Wait for the server to start | |
fi | |
find test-suites -type f -name "*.yaml" -exec python ./testing.py -f {} -V -e ${{ matrix.env }} \; | |
shell: bash |