Workflow fixes #2
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: 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.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] | ||
python: ["3.11"] | ||
# platform: ["windows-latest", "ubuntu-latest", "macos-latest"] | ||
platform: ["ubuntu-latest"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
sparse-checkout: | | ||
codegen | ||
tests | ||
- 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: unzip codegen_results.zip src/gdmath | ||
- name: Test Download | ||
run: dir src\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: Test | ||
run: pytest tests |