8000 build using Py3.8 and test across more OSs by mr-tz · Pull Request #506 · mandiant/capa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

build using Py3.8 and test across more OSs #506

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

Merged
merged 3 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 40 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: build

on:
push:
branches: [master]
release:
types: [edited, published]

Expand All @@ -26,10 +28,11 @@ jobs:
uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.9
# using Python 3.8 to support running across multiple operating systems including Windows 7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good comment

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.8
- if: matrix.os == 'ubuntu-16.04'
run: sudo apt-get install -y libyaml-dev
- name: Install PyInstaller
Expand All @@ -45,10 +48,42 @@ jobs:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.artifact_name }}

zip:
name: zip ${{ matrix.asset_name }}
test_run:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not really like to test this in the build workflow. I mean, we release and if any OS fails we don't upload any binary. It would be better to test this before releasing. What about adding a test build workflow which is run in master (which should be green before releasing) and removing it from here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, how can we do this on a per-case basis? maybe via a specific activity type https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release?

Copy link
Member
@Ana06 Ana06 Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? running it only on a release PR?

My proposal was to create a build_test.yml which is run on master:

on:
  push:
    branches:
      - master

alternatively we could test it on every PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of duplicating steps in a new workflow file my new proposal uses if checks to test_run on push to master or to zip on release.

# test that binaries run on push to master
if: github.event_name == 'push'
name: Test run on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: [build]
strategy:
matrix:
include:
# OSs not already tested above
- os: ubuntu-18.04
artifact_name: capa
asse 8000 t_name: linux
- os: ubuntu-20.04
artifact_name: capa
asset_name: linux
- os: windows-2016
artifact_name: capa.exe
asset_name: windows
steps:
- name: Download ${{ matrix.asset_name }}
uses: actions/download-artifact@v2
with:
name: ${{ matrix.asset_name }}
- name: Set executable flag
if: matrix.os != 'windows-2016'
run: chmod +x ${{ matrix.artifact_name }}
- name: Run capa
run: ./${{ matrix.artifact_name }} -h

zip_and_upload:
# upload zipped binaries to Release page
if: github.event_name == 'release'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do this only for release events

name: zip and upload ${{ matrix.asset_name }}
runs-on: ubuntu-20.04
needs: build
needs: [build]
strategy:
matrix:
include:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The first Python 3 ONLY capa version.

### Bug Fixes

- build: use Python 3.8 for PyInstaller to support consistently running across multiple operating systems including Windows 7 #505 @mr-tz

### Changes

- py3: drop Python 2 support #480 @Ana06
Expand Down
0