Pytest Local Repo Devcontainer Across Versions #669
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Pytest Local Repo Devcontainer Across Versions | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'ghidriff/**' | |
- 'tests/**' | |
- '.github/workflows/pytest-devcontainer-repo-all.yml' | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: '30 5,15 * * *' | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# cover the latest and all versions of all subreleases | |
image: [ | |
"latest", | |
"11.1.1ghidra3.12python-bookworm", | |
"11.0.3ghidra3.11python-bookworm", | |
"10.4ghidra3.11python-bookworm", | |
"10.4ghidra3.9python-bookworm", | |
"10.3.3ghidra3.10python-bookworm", | |
] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Overwrite original devcontainer with workflow devcontainer | |
run: | | |
cp .github/workflows/devcontainer.json .devcontainer/devcontainer.json | |
- name: Test with pytest on devcontainer | |
env: | |
# this will set the imageName in the base docker container .github/workflows/.devcontainer/devcontainer.json | |
# (which is needed because imageName for devcontainers/[email protected] doesn't affect which image you use! | |
DC_IMAGE_TAG : ${{matrix.image}} | |
uses: devcontainers/[email protected] | |
with: | |
# this is not the image name used for building the dev container. | |
imageName: ghcr.io/clearbluejar/ghidra-python | |
cacheFrom: ghcr.io/clearbluejar/ghidra-python | |
imageTag: ${{matrix.image}} | |
push: never | |
#platform: linux/amd64,linux/arm64 | |
runCmd: | | |
env | |
ls /usr/local/include/ | |
pip install --upgrade pip | |
python -m venv env | |
source env/bin/activate | |
# install package and testing | |
pip install -e ".[testing]" | |
# install plugins before use | |
python -m pyhidra.install_plugins | |
# download data to shared test data | |
if [ ! -d "tests/data" ]; then git clone https://github.com/clearbluejar/ghidriff-test-data.git tests/data; fi | |
pytest -rA -n auto |