Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workflows #50

Merged
merged 54 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
4e77e6e
revert devcontainer python 3.11 until python3.12 is stable, use vscod…
clearbluejar Oct 20, 2023
5b03570
switch to vscode user for runner
clearbluejar Oct 20, 2023
8446e1f
switch back to root user, try virtual env
clearbluejar Oct 20, 2023
97b1aaf
run step with bash
clearbluejar Oct 20, 2023
285c2ea
random tmp dir fix it?
clearbluejar Oct 20, 2023
3560629
push pop
clearbluejar Oct 20, 2023
2f6c7cc
another tmp dir
clearbluejar Oct 20, 2023
93f7f8f
start pyhidra background
clearbluejar Oct 20, 2023
4e595a4
try over two runs
clearbluejar Oct 20, 2023
47c1857
add branch to workflow
clearbluejar Oct 20, 2023
19b81b4
checkout to new dir
clearbluejar Oct 20, 2023
a4b9bd5
another fix attempt
clearbluejar Oct 30, 2023
aae3d0b
add pypi install workflow
clearbluejar Oct 30, 2023
a35eb6f
still trying to get this
clearbluejar Oct 30, 2023
39c2696
switch users
clearbluejar Oct 30, 2023
d384a27
another
clearbluejar Oct 30, 2023
8042375
try again
clearbluejar Oct 30, 2023
0c76998
another
clearbluejar Oct 30, 2023
9140bf5
another
clearbluejar Oct 30, 2023
f8d2a31
another1
clearbluejar Oct 30, 2023
b7a71aa
add verbose
clearbluejar Oct 30, 2023
03fa665
another2
clearbluejar Oct 30, 2023
83b0077
softlink try
clearbluejar Oct 30, 2023
d5b7b4f
fix home
clearbluejar Oct 30, 2023
600b616
fix home2
clearbluejar Oct 30, 2023
f1e4ef7
another1
clearbluejar Oct 30, 2023
563506e
add platform
clearbluejar Oct 30, 2023
274fd31
remove matrix
clearbluejar Oct 30, 2023
4507751
remove platforms
clearbluejar Oct 30, 2023
a583a03
add another devcontainer
clearbluejar Oct 30, 2023
cb4dab0
move file
clearbluejar Oct 30, 2023
d72dd1f
fix
clearbluejar Oct 30, 2023
8a55d2d
move files
clearbluejar Oct 30, 2023
f7be692
again
clearbluejar Oct 30, 2023
89ad864
remove base image
clearbluejar Oct 31, 2023
23d509d
again
clearbluejar Oct 31, 2023
61c4f38
again
clearbluejar Oct 31, 2023
7fb4ce4
again
clearbluejar Oct 31, 2023
dbcaead
again
clearbluejar Oct 31, 2023
d1f87cb
again
clearbluejar Oct 31, 2023
92aed34
again
clearbluejar Oct 31, 2023
4b3d6bf
again
clearbluejar Oct 31, 2023
7f3ddb0
again
clearbluejar Oct 31, 2023
565cd6e
again
clearbluejar Oct 31, 2023
376954e
this one for sure
clearbluejar Oct 31, 2023
a12b1ab
again
clearbluejar Oct 31, 2023
ab9c368
again
clearbluejar Oct 31, 2023
b030203
again
clearbluejar Oct 31, 2023
802f0d8
again
clearbluejar Oct 31, 2023
5f612bf
again
clearbluejar Oct 31, 2023
ae6ba4a
again
clearbluejar Oct 31, 2023
5c4a806
again
clearbluejar Oct 31, 2023
ba06aeb
again
clearbluejar Oct 31, 2023
3772054
again
clearbluejar Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
"name": "ghidriff",
// image from https://github.com/clearbluejar/ghidra-python
"image": "ghcr.io/clearbluejar/ghidra-python:latest",
//"image": "ghcr.io/clearbluejar/ghidra-python:latest",
"image": "ghcr.io/clearbluejar/ghidra-python:10.4ghidra3.11python-bookworm",
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ pip install --upgrade pip
# Download latest pyi typings for Ghidra Version
pip install ghidra-stubs

# Install pyhdira
pip install pyhidra

# If arm64 os, need to build native binaries for Ghidra
if uname -a | grep -q 'aarch64'; then
$GHIDRA_INSTALL_DIR/support/buildNatives
Expand All @@ -19,6 +16,9 @@ fi
# install local workspace and test requirements
pip install -e ".[testing]"

# initialize pyhidra
python -m pyhidra.install_plugins

# git clone test data if dir doesn't exist
TEST_DATA_PATH="tests/data"

Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/python-3
{
"name": "ghidriff",
// image from https://github.com/clearbluejar/ghidra-python
//"image": "ghcr.io/clearbluejar/ghidra-python:latest",
"image": "ghcr.io/clearbluejar/ghidra-python:${localEnv:DC_IMAGE_TAG}",
// Configure tool-specific properties.
// "customizations": {
// // Configure properties specific to VS Code.
// "vscode": {
// // Set *default* container specific settings.json values on container create.
// "settings": {
// "python.defaultInterpreterPath": "/usr/local/bin/python",
// "python.linting.enabled": true,
// "python.linting.pylintEnabled": true,
// "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
// "python.formatting.blackPath": "/usr/local/py-utils/bin/black",
// "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
// "python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
// "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
// "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
// "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
// "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
// "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
// // VS code settings for ghidra-stubs autocomplete
// "python.analysis.stubPath": "${workspaceFolder}/.env/lib/python3.11/site-packages/ghidra-stubs/",
// "python.autoComplete.extraPaths": [
// "${workspaceFolder}/.env/lib/python3.11/site-packages/ghidra-stubs/"
// ],
// "python.analysis.extraPaths": [
// "${workspaceFolder}/.env/lib/python3.11/site-packages/ghidra-stubs/"
// ],
// "[python]": {
// "editor.formatOnSave": true,
// },
// },
// // Add the IDs of extensions you want installed when the container is created.
// "extensions": [
// "ms-python.python",
// "ms-python.vscode-pylance",
// "yzhang.markdown-all-in-one"
// ]
// }
// },
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": [
// "bash",
// ".devcontainer/post-create.sh"
// ],
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
}
54 changes: 54 additions & 0 deletions .github/workflows/pytest-devcontainer-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 Python PyPi Package Repo In Devcontainer

on:
push:
branches: [ "main" ]
paths:
- '.github/workflows/pytest-devcontainer-pypi.yml'
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
# add "latest" when jpype is update for python 3.12
image: ["10.4ghidra3.11python-bookworm","10.4ghidra3.9python-bookworm", "10.3.3ghidra3.10python-bookworm", "10.2.3ghidra3.11python-bookworm", "10.1.5ghidra3.11python-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
# install package and testing
# install from pypi
pip install "ghidriff[testing]"
pip list
# 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
54 changes: 54 additions & 0 deletions .github/workflows/pytest-devcontainer-repo-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 Python Package Repo Devcontainer Across Versions

on:
push:
branches: [ "main", "fix-workflows" ]
paths:
- 'ghidriff/**'
- 'tests/**'
- '.github/workflows/pytest-devcontainer-repo-all.yml'
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# cover the latest and all versions of all subreleases
# add "latest" when jpype is update for python 3.12
image: ["10.4ghidra3.11python-bookworm","10.4ghidra3.9python-bookworm", "10.3.3ghidra3.10python-bookworm", "10.2.3ghidra3.11python-bookworm", "10.1.5ghidra3.11python-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
# install package and testing
pip install -e ".[testing]"
# 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
21 changes: 8 additions & 13 deletions .github/workflows/pytest-devcontainer.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# 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 Python Package In Devcontainer
name: Pytest Python Package Devcontainer

on:
push:
branches: [ "main" ]
branches: [ "main", "fix-workflows" ]
paths:
- 'ghidriff/**'
- 'tests/**'
- '.github/workflows/pytest-devcontainer.yml'
pull_request:
branches: [ "main" ]
workflow_dispatch:
Expand All @@ -17,21 +18,15 @@ jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# cover the latest and all versions of all subreleases
image: ["latest", "10.4ghidra3.9python-bookworm", "10.3.3ghidra3.10python-bookworm", "10.2.3ghidra3.11python-bookworm", "10.1.5ghidra3.11python-bookworm" ]


steps:
- uses: actions/checkout@v3
- name: Test with pytest on devcontainer
- name: Test with pytest on devcontainer
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/clearbluejar/ghidra-python
# cacheFrom: ghcr.io/clearbluejar/ghidra-python
imageTag: ${{matrix.image}}
with:
cacheFrom: ghcr.io/clearbluejar/ghidra-python
push: never
#platform: linux/amd64,linux/arm64
runCmd: |
env
ls /usr/local/include/
Expand Down
47 changes: 34 additions & 13 deletions .github/workflows/pytest-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ name: Pytest Python Package In Docker Image

on:
push:
branches: [ "main" ]
# branches: [ "main" ]
paths:
- 'ghidriff/**'
- 'tests/**'
pull_request:
branches: [ "main" ]
# - 'ghidriff/**'
# - 'tests/**'
- '.github/workflows/pytest-docker.yml'
# pull_request:
# branches: [ "main" ]
workflow_dispatch:

jobs:
Expand All @@ -21,7 +22,7 @@ jobs:
fail-fast: false
matrix:
# cover the latest and all versions of all subreleases
image: ["latest", "10.4ghidra3.9python-bookworm", "10.3.3ghidra3.10python-bookworm", "10.2.3ghidra3.11python-bookworm", "10.1.5ghidra3.11python-bookworm" ]
image: ["10.4ghidra3.11python-bookworm", "10.4ghidra3.9python-bookworm", "10.3.3ghidra3.10python-bookworm", "10.2.3ghidra3.11python-bookworm", "10.1.5ghidra3.11python-bookworm" ]

container:
image: ghcr.io/clearbluejar/ghidra-python:${{ matrix.image }}
Expand All @@ -30,14 +31,34 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: |
pwd
ls -a
with:
path: ghidriff
- run: |
mkdir -p /github
ln -s /root $HOME # Create Symlink /github/home
#chown -R 777 /__w
# python -m venv .env
# source .env/bin/activate
# ls -a
env
ls /usr/local/include/
# ls /usr/local/include/
ls -R ~/.
pip install --upgrade pip
# install package and testing
pip install -e ".[testing]"
cd ghidriff
# install ghidriff package and testing reqs
pip install ".[testing]"
ls -R /root
#pyhidra &
#sleep 10
#killall python
# source .env/bin/activate
# #init pyhidra
python -m pyhidra.install_plugins
# pushd /tmp
# popd
# 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

pytest -rAv
shell: bash