Skip to content

cicd-windows

cicd-windows #19

Workflow file for this run

# TODO:
# (-) Install dfx in WSL
# (-) the tool installation
# Reference: https://github.com/WebAssembly/wasi-sdk/blob/main/.github/workflows/main.yml
name: cicd-windows
on:
workflow_dispatch:
push:
paths:
- "src/**"
- "test/**"
- "Makefile"
- ".github/trigger.txt"
- ".github/workflows/cicd-windows.yml"
jobs:
all-windows:
name: all-windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.11]
include:
- arch: x64
steps:
# https://github.com/marketplace/actions/setup-miniconda
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
- name: Anaconda PowerShell Check
shell: powershell
run: |
conda info
conda list
# -------------------------------------------------------------------
# Checkout icpp-pro & icpp-candid as nested directory
- name: checkout icpp-pro
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: checkout icpp-candid
uses: actions/checkout@v4
with:
repository: icppWorld/icpp-candid
path: icpp-candid
fetch-depth: 0
# -------------------------------------------------------------------
# Install icpp with python dependencies
- name: Install icpp-candid from setup.py in conda shell
shell: powershell
run: |
pip install --upgrade pip
cd icpp-candid
pip install -e ".[dev]"
- name: Install icpp-pro from setup.py in conda shell
shell: powershell
run: |
pip install -e ".[dev]"
- name: Check versions in conda shell
shell: powershell
run: |
echo "icpp --version: $(icpp --version)"
echo "pip version : $(pip --version)"
echo "python version : $(python --version)"
echo "Ensure conda works properly"
conda info
where pip
where python
where icpp
# -------------------------------------------------------------------
# Run the native tests - only mingw64 is needed
- name: install-mingw64
shell: powershell
run: |
echo "Installing mingw64"
icpp install-mingw64
- name: native mockic test
shell: powershell
run: |
echo "Testing all_canister_native"
python -m scripts.all_canister_native
# -------------------------------------------------------------------
# Run the smoke tests - requires wasi-sdk & rust with dependencies
- name: install-wasi-sdk
shell: powershell
run: |
echo "Installing wasi-sdk"
icpp install-wasi-sdk
- name: install-rust
shell: powershell
run: |
echo "Installing rust"
icpp install-rust
# -------------------------------------------------------------------
# Build wasm for all the canisters
- name: build-wasm greet canister
shell: powershell
run: |
cd .\src\icpp\canisters\greet
icpp build-wasm --generate-bindings no
- name: build-wasm test\canisters\canister_1
shell: powershell
run: |
cd .\test\canisters\canister_1
icpp build-wasm --generate-bindings no
- name: build-wasm test\canisters\canister_flags
shell: powershell
run: |
cd .\test\canisters\canister_flags
icpp build-wasm --generate-bindings no
- name: build-wasm test\canisters\canister_http
shell: powershell
run: |
cd .\test\canisters\canister_http
icpp build-wasm --generate-bindings no
# ********************************************************************************
# *** CAN'T GET THIS TO WORK IN A GITHUB ACTION ***
# *** This runs ok locally: python -m scripts.all_canister_deploy_local_pytest ***
# ********************************************************************************
# -------------------------------------------------------------------
# # Set up wsl
# #
# - name: enable WSL
# run: |
# echo "Enabling WSL"
# dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# shell: pwsh
# - name: wsl setup with Vampire
# uses: Vampire/setup-wsl@v3
# with:
# distribution: Ubuntu-20.04
# additional-packages:
# build-essential
# - name: pwd in wsl-bash
# shell: wsl-bash {0}
# run: pwd
# - name: install dfx in wsl-bash
# shell: wsl-bash {0}
# run: make install-dfx
# - name: configure dfx in wsl-bash
# shell: wsl-bash {0}
# run: source "$HOME/.local/share/dfx/env"
# - name: smoketest
# shell: powershell
# run: |
# echo "Testing all_canister_deploy_local_pytest"
# python -m scripts.all_canister_deploy_local_pytest