Skip to content

Tests

Tests #29

Workflow file for this run

name: Tests
on:
workflow_run:
workflows: [Codegen]
types: [completed]
jobs:
tests:
runs-on: ${{ matrix.platform }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: true
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]
platform: ["windows-latest", "ubuntu-latest", "macos-latest"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Codegen Output
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "codegen_results"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/codegen_results.zip`, Buffer.from(download.data));
- name: Unzip
run: 7z x codegen_results.zip -osrc/gdmath
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Build
run: pip install .
- name: Run Tests
run: pytest tests