mirror of https://github.com/Nonannet/copapy.git
105 lines
2.3 KiB
YAML
105 lines
2.3 KiB
YAML
name: CI Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build-ubuntu:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Python dependencies
|
|
run: python -m pip install -e .[dev]
|
|
|
|
- name: Build ops obj files and runner
|
|
run: bash src/copapy/obj/nativecompile.sh
|
|
|
|
#- name: Lint code with flake8
|
|
# run: flake8
|
|
|
|
- name: Upload obj files
|
|
uses: actions/upload-artifact@v4
|
|
if: strategy.job-index == 0
|
|
with:
|
|
name: stencil-object-files
|
|
path: src/copapy/obj/*.o
|
|
|
|
- name: Upload compiled runner
|
|
uses: actions/upload-artifact@v4
|
|
if: strategy.job-index == 0
|
|
with:
|
|
name: runner-linux
|
|
path: bin/*
|
|
|
|
- name: Run tests with pytest
|
|
run: pytest
|
|
|
|
- name: Type checking with mypy
|
|
run: mypy
|
|
|
|
build-windows:
|
|
needs: [build-ubuntu]
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: stencil-object-files
|
|
path: src/copapy/obj
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Python dependencies
|
|
run: python -m pip install -e .[dev]
|
|
|
|
- name: Set up MSVC environment
|
|
uses: microsoft/setup-msbuild@v2
|
|
with:
|
|
vs-version: 'latest'
|
|
|
|
- name: Compile
|
|
shell: cmd
|
|
run: |
|
|
mkdir bin
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64
|
|
cl /O2 src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:bin\coparun.exe
|
|
|
|
- name: Run tests with pytest
|
|
run: pytest
|
|
|
|
- name: Type checking with mypy
|
|
run: mypy
|
|
|
|
#- name: Lint code with flake8
|
|
# run: flake8
|
|
|
|
- name: Upload compiled runner
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: runner-win
|
|
path: bin/* |