Skip to content

Commit

Permalink
Merge pull request #5 from BritishGeologicalSurvey/macos-pipeline
Browse files Browse the repository at this point in the history
Macos pipeline
volcan01010 authored Jun 30, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 1145f7a + 443a4cc commit 7e493bf
Showing 6 changed files with 139 additions and 70 deletions.
41 changes: 27 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create executable using PyInstaller
name: Create Distributable Files

on:
release:
@@ -7,35 +7,48 @@ on:

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
include:
- os: windows
app_file_ext: "exe"
asset_file_ext: "exe"
- os: macos
app_file_ext: "app"
asset_file_ext: "zip"
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3

- name: Create Anaconda Environment
- name: Activate Anaconda Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: tactool
environment-file: environment.yml
environment-file: environments/${{ matrix.os }}-environment.yml
python-version: 3.11
auto-activate-base: false

- name: Build with PyInstaller
shell: bash -l {0}
run: pyinstaller --name="TACtool" --windowed --paths=. --onefile tactool/main.py
run: pyinstaller --name="tactool" --windowed --paths=. --onefile tactool/main.py

- name: Get Latest Release Info
id: latest_release_info
uses: jossef/action-latest-release-info@v1.2.1
- name: ZIP Application
if: matrix.os == 'macos'
run: |
cd dist
zip -r tactool.${{ matrix.asset_file_ext }} tactool.${{ matrix.app_file_ext }}
- name: Get Release Info
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Add Asset to Latest Release
- name: Add Asset to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
asset_path: dist/TACtool.exe
asset_name: TACtool.exe
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: dist/tactool.${{ matrix.asset_file_ext }}
asset_name: ${{ matrix.os }}-tactool.${{ matrix.asset_file_ext }}
asset_content_type: application

18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name: Lint and run tests
name: Lint and Test

on:
push:
paths:
- '**.py'

jobs:
lint-and-test:
runs-on: windows-latest
test:
strategy:
matrix:
os: [windows, macos]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3

- name: Create Anaconda Environment
- name: Activate Anaconda Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: tactool
environment-file: environment.yml
environment-file: environments/${{ matrix.os }}-environment.yml
python-version: 3.11
auto-activate-base: false

@@ -27,6 +29,4 @@ jobs:
shell: bash -l {0}
run: |
export PYTHONPATH=.
pytest -vv test/
pytest -vs test/
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,12 +2,14 @@

> A graphical tool for selecting points for analysis on an SEM image
### To use on Windows:
### Download

- Download latest Windows build by clicking [here](https://github.com/BritishGeologicalSurvey/tactool/releases/latest/download/TACtool.exe).
- Double click to run. On first run it takes a while to load.
- Instructions for using the application can be found [here](https://github.com/BritishGeologicalSurvey/tactool/blob/main/instructions.md).
You can download the **TACtool** application here:

- [Windows](https://github.com/BritishGeologicalSurvey/tactool/releases/latest/download/windows-tactool.exe)
- [MacOS](https://github.com/BritishGeologicalSurvey/tactool/releases/latest/download/macos-tactool.zip)

Instructions for using the application can be found [here](https://github.com/BritishGeologicalSurvey/tactool/blob/main/instructions.md).

## Class Relationship Diagram

@@ -224,16 +226,37 @@

## Installation

Check out the repository and install dependencies
Check out the repository and install dependencies using Anaconda.

### Windows
```bash
conda env create -f environments/windows-environment.yml
conda activate tactool-windows
```

### MacOS
```bash
pip install -r requirements.txt
conda env create -f environments/macos-environment.yml
conda activate tactool-macos
```

Run the tool with:
## Running the Program

To run the program, first you need to setup your Python path.

#### Windows
```bash
$env:PYTHONPATH="."
```

#### MacOS
```bash
export PYTHONPATH=.
```

Then you can run the program with:

```bash
python tactool/main.py --dev
```

@@ -242,10 +265,9 @@ pre-loaded into the GraphicsView.

## Running tests

Run the tests with:
Ensure you have setup your Python path. Then you can run the tests with:

```bash
export PYTHONPATH=.
pytest -vv test/
```

38 changes: 0 additions & 38 deletions environment.yml

This file was deleted.

35 changes: 35 additions & 0 deletions environments/macos-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: tactool-macos
channels:
- defaults
dependencies:
- bzip2=1.0.8=h1de35cc_0
- ca-certificates=2023.05.30=hecd8cb5_0
- libffi=3.4.4=hecd8cb5_0
- ncurses=6.4=hcec6c5f_0
- openssl=3.0.9=hca72f7f_0
- pip=23.1.2=py311hecd8cb5_0
- python=3.11.3=hf27a42d_1
- readline=8.2=hca72f7f_0
- setuptools=67.8.0=py311hecd8cb5_0
- sqlite=3.41.2=h6c40b1e_0
- tk=8.6.12=h5d9f67b_0
- tzdata=2023c=h04d1e81_0
- wheel=0.38.4=py311hecd8cb5_0
- xz=5.4.2=h6c40b1e_0
- zlib=1.2.13=h4dc903c_0
- pip:
- altgraph==0.17.3
- flake8==6.0.0
- iniconfig==2.0.0
- macholib==1.16.2
- mccabe==0.7.0
- packaging==23.1
- pluggy==1.2.0
- pycodestyle==2.10.0
- pyflakes==3.0.1
- pyinstaller==5.13.0
- pyinstaller-hooks-contrib==2023.4
- pyqt5==5.15.9
- pyqt5-qt5==5.15.2
- pyqt5-sip==12.12.1
- pytest==7.4.0
37 changes: 37 additions & 0 deletions environments/windows-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: tactool-windows
channels:
- defaults
dependencies:
- bzip2=1.0.8=he774522_0
- ca-certificates=2023.05.30=haa95532_0
- libffi=3.4.4=hd77b12b_0
- openssl=3.0.9=h2bbff1b_0
- pip=23.1.2=py311haa95532_0
- python=3.11.3=he1021f5_1
- setuptools=67.8.0=py311haa95532_0
- sqlite=3.41.2=h2bbff1b_0
- tk=8.6.12=h2bbff1b_0
- tzdata=2023c=h04d1e81_0
- vc=14.2=h21ff451_1
- vs2015_runtime=14.27.29016=h5e58377_2
- wheel=0.38.4=py311haa95532_0
- xz=5.4.2=h8cc25b3_0
- zlib=1.2.13=h8cc25b3_0
- pip:
- altgraph==0.17.3
- colorama==0.4.6
- flake8==6.0.0
- iniconfig==2.0.0
- mccabe==0.7.0
- packaging==23.1
- pefile==2023.2.7
- pluggy==1.2.0
- pycodestyle==2.10.0
- pyflakes==3.0.1
- pyinstaller==5.13.0
- pyinstaller-hooks-contrib==2023.4
- pyqt5==5.15.9
- pyqt5-qt5==5.15.2
- pyqt5-sip==12.12.1
- pytest==7.4.0
- pywin32-ctypes==0.2.2

0 comments on commit 7e493bf

Please sign in to comment.