Skip to content

Commit

Permalink
Merge pull request #42 from zefhub/dev
Browse files Browse the repository at this point in the history
Atom and object notation changes
  • Loading branch information
pengwyn authored Mar 8, 2023
2 parents 0c93a72 + 7b81506 commit 4528057
Show file tree
Hide file tree
Showing 163 changed files with 10,052 additions and 1,528 deletions.
47 changes: 44 additions & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
default: 'true'
required: false

test-auth-key:
default: ''
required: false

runs:
using: 'composite'
steps:
Expand Down Expand Up @@ -151,14 +155,22 @@ runs:
# cmake then rebuild.

- name: Make
if: steps.build-cache.outputs.cache-hit != 'true'
if: ${{ steps.build-cache.outputs.cache-hit != 'true' && !startsWith(inputs.os, 'windows') }}
env:
WITH_JULIA: ${{ (inputs.with-julia == 'true') && '1' || '0' }}
shell: bash
run: |
export PATH=$(python3 -m site --user-base)/bin:$PATH
bash compile_for_local_dev.sh
- name: Make
if: ${{ steps.build-cache.outputs.cache-hit != 'true' && startsWith(inputs.os, 'windows') }}
env:
WITH_JULIA: ${{ (inputs.with-julia == 'true') && '1' || '0' }}
shell: powershell
run: |
powershell .\compile_for_local_dev.ps1
#########
# Testing
- name: Prep for python tests
Expand All @@ -168,6 +180,32 @@ runs:
pip3 install --user -r python/requirements.txt
pip3 install --user -r python/tests/requirements_tests.txt
- name: Robot Framework tests
id: robot-framework
if: ${{ inputs.test-auth-key != '' && !startsWith(inputs.os, 'windows') }}
shell: bash
env:
ZEFDB_QUIET: YES
ZEF_ERROR_HANDLING: NO
# Because the robot tests end up creating/loading graphs, we need a real user here
ZEFHUB_AUTH_KEY: ${{ inputs.test-auth-key }}
run: |
export PYTHONPATH="${GITHUB_WORKSPACE}/python:$PYTHONPATH"
cd python/tests/robot
bash runtests.sh
- name: Save robot logs on failure
if: ${{ failure() && steps.robot-framework.outcome == 'failure' }}
uses: actions/upload-artifact@v3
with:
name: robot-logs
path: |
python/tests/robot/output.xml
python/tests/robot/log.html
python/tests/robot/report.html
/tmp/zefrobot*

- name: Check no created tokens
if: ${{ inputs.run-tests == 'true' && !startsWith(inputs.os, 'windows') }}
shell: bash
Expand All @@ -191,22 +229,25 @@ runs:
shell: bash
env:
ZEFDB_QUIET: YES
ZEF_ERROR_HANDLING: NO
ZEFHUB_AUTH_KEY: GUEST
run: |
export PYTHONPATH="${GITHUB_WORKSPACE}/python:$PYTHONPATH"
python3 python/tests/quick_start.py
python3 -mpytest python/tests
python3 -mpytest --tb=no python/tests
- name: Run python tests
if: ${{ inputs.run-tests == 'true' && startsWith(inputs.os, 'windows') }}
shell: cmd
env:
ZEFDB_QUIET: YES
ZEF_ERROR_HANDLING: NO
ZEFHUB_AUTH_KEY: GUEST
run: |
set "PYTHONPATH=%GITHUB_WORKSPACE%/python;%PYTHONPATH%"
copy python\pyzef\build\Release\pyzef.* python\zef
python3 python/tests/quick_start.py
REM Because of some strange weirdness, going to try unittest here instead of pytest
REM python3 -mpytest python/tests
python3 -munittest discover -s python/tests
python3 -munittest discover -s python/tests
15 changes: 13 additions & 2 deletions .github/workflows/manual-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ on:
required: true
default: true
type: boolean
targetEnvironment:
required: true
type: environment


env:
ZEFHUB_AUTH_KEY: "GUEST"
ZEFHUB_AUTH_KEY: GUEST


jobs:
check-license:
Expand All @@ -30,6 +35,7 @@ jobs:
if: inputs.linuxBuild == true
needs: check-license
runs-on: ${{ matrix.os }}
environment: ${{ inputs.targetEnvironment }}
strategy:
matrix:
os: [ubuntu-20.04]
Expand All @@ -46,11 +52,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test-auth-key: ${{ secrets.TEST_AUTH_KEY }}

macos-build:
if: inputs.macosBuild == true
needs: check-license
runs-on: ${{ matrix.os }}
environment: ${{ inputs.targetEnvironment }}
strategy:
matrix:
os: [macos-latest]
Expand All @@ -67,11 +75,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test-auth-key: ${{ secrets.TEST_AUTH_KEY }}

windows-build:
if: inputs.windowsBuild == true
needs: check-license
runs-on: ${{ matrix.os }}
environment: ${{ inputs.targetEnvironment }}
strategy:
matrix:
os: [windows-latest]
Expand All @@ -87,4 +97,5 @@ jobs:
timeout-minutes: 30
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
os: ${{ matrix.os }}
test-auth-key: ${{ secrets.TEST_AUTH_KEY }}
4 changes: 2 additions & 2 deletions .github/workflows/on-master-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
# check-license is quick and we want to abort quickly if that fails
needs: check-license
runs-on: ${{ matrix.os }}
environment: Release
strategy:
matrix:
# os: [ubuntu-20.04, macos-latest, windows-latest]
Expand All @@ -24,8 +25,6 @@ jobs:
python-version: 3.7
- os: windows-latest
python-version: 3.7
env:
ZEFHUB_AUTH_KEY: "GUEST"
steps:
########
# Git things
Expand All @@ -40,6 +39,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test-auth-key: ${{ secrets.TEST_AUTH_KEY }}

- uses: 8398a7/action-slack@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Build
uses: ./.github/actions/build
timeout-minutes: 15
timeout-minutes: 25
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-20.04, macos-latest, windows-latest]
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, macos-latest, windows-latest]
# os: [ubuntu-20.04, macos-latest]
python-version: [3.7, "3.10", "3.11"]
exclude:
- os: macos-latest
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Build
uses: ./.github/actions/build
# Windows takes forever to build so this needs to be >20min
timeout-minutes: 30
timeout-minutes: 45
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
Expand Down
82 changes: 45 additions & 37 deletions .github/workflows/pyzef-pypi-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ jobs:
needs: check-license
name: Build wheels
runs-on: ${{ matrix.os }}
environment: Release
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, macos-latest, windows-latest]
# os: [windows-latest]
# os: [ubuntu-20.04, macos-latest]
# Note: need "3.10" as yaml will truncate floating point number
python-version: ["cp39", "cp310", "cp311"]
# python-version: ["cp39"]
env:
ZEFHUB_AUTH_KEY: "GUEST"
# ZEFHUB_AUTH_KEY: "GUEST"
ZEFHUB_AUTH_KEY: "${{ secrets.TEST_AUTH_KEY }}"

steps:
########
Expand All @@ -33,11 +38,14 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build wheels
uses: pypa/[email protected]
uses: pypa/[email protected]
# Windows takes forever to build so this needs to be >20min
timeout-minutes: 45
with:
package-dir: python
env:
CIBW_BUILD: "${{ matrix.python-version}}*"
# CIBW_BUILD_VERBOSITY: 3

- name: save wheels in artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -96,40 +104,40 @@ jobs:
pip3 install --upgrade twine
python3 -m twine upload -u __token__ -p "${PYPI_TOKEN}" --skip-existing wheelhouse/*
dev-announcement:
name: Dev announcement
runs-on: ubuntu-20.04
needs: [upload-to-pypi]
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
# dev-announcement:
# name: Dev announcement
# runs-on: ubuntu-20.04
# needs: [upload-to-pypi]
# steps:
# - uses: actions/checkout@v3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# persist-credentials: true

- name: Get tag
id: vars
run: |
echo "tag=${GITHUB_REF##*/pyzef-}" >> $GITHUB_OUTPUT
# - name: Get tag
# id: vars
# run: |
# echo "tag=${GITHUB_REF##*/pyzef-}" >> $GITHUB_OUTPUT

# - name: Release announcement
# if: ${{ (!contains(github.ref, 'dev') && github.event.release.prerelease == false) }}
# env:
# MATTERMOST_URL: ${{ secrets.MATTERMOST_URL }}
# CHANNEL: releases
# NAME: ${{ github.event.release.name }}
# DESCRIPTION: ${{ github.event.release.body }}
# VERSION_STRING: ${{ steps.vars.outputs.tag }}
# DOWNLOAD_STRING: "`pip3 install --upgrade zef`"
# run: go run ${GITHUB_WORKSPACE}/.github/scripts/publish_release_announcement.go
# # - name: Release announcement
# # if: ${{ (!contains(github.ref, 'dev') && github.event.release.prerelease == false) }}
# # env:
# # MATTERMOST_URL: ${{ secrets.MATTERMOST_URL }}
# # CHANNEL: releases
# # NAME: ${{ github.event.release.name }}
# # DESCRIPTION: ${{ github.event.release.body }}
# # VERSION_STRING: ${{ steps.vars.outputs.tag }}
# # DOWNLOAD_STRING: "`pip3 install --upgrade zef`"
# # run: go run ${GITHUB_WORKSPACE}/.github/scripts/publish_release_announcement.go

- name: Release announcement for dev
env:
MATTERMOST_URL: ${{ secrets.MATTERMOST_URL }}
CHANNEL: "dev-releases"
NAME: ${{ steps.vars.outputs.tag }}
DESCRIPTION_FILE: "release.body"
VERSION_STRING: ${{ steps.vars.outputs.tag }}
DOWNLOAD_STRING: "`pip install zef==${{ steps.vars.outputs.tag }}`"
run: |
echo "Alpha/dev release of PyPI wheels for version ${VERSION_STRING}" > release.body
go run ${GITHUB_WORKSPACE}/.github/scripts/publish_release_announcement.go
# - name: Release announcement for dev
# env:
# MATTERMOST_URL: ${{ secrets.MATTERMOST_URL }}
# CHANNEL: "dev-releases"
# NAME: ${{ steps.vars.outputs.tag }}
# DESCRIPTION_FILE: "release.body"
# VERSION_STRING: ${{ steps.vars.outputs.tag }}
# DOWNLOAD_STRING: "`pip install zef==${{ steps.vars.outputs.tag }}`"
# run: |
# echo "Alpha/dev release of PyPI wheels for version ${VERSION_STRING}" > release.body
# go run ${GITHUB_WORKSPACE}/.github/scripts/publish_release_announcement.go
12 changes: 8 additions & 4 deletions .github/workflows/pyzef-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
needs: check-license
name: Build wheels
runs-on: ${{ matrix.os }}
environment: Release
strategy:
matrix:
# os: [ubuntu-20.04, macos-latest, windows-latest]
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, macos-latest, windows-latest]
# os: [ubuntu-20.04, macos-latest]
# os: [ubuntu-20.04]
# Note: need "3.10" as yaml will truncate floating point number
python-version: ["cp37", "cp38", "cp39", "cp310", "cp311"]
Expand All @@ -29,7 +30,8 @@ jobs:
- os: macos-latest
python-version: "cp37"
env:
ZEFHUB_AUTH_KEY: "GUEST"
# ZEFHUB_AUTH_KEY: "GUEST"
ZEFHUB_AUTH_KEY: "${{ secrets.TEST_AUTH_KEY }}"

steps:
########
Expand All @@ -39,7 +41,9 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build wheels
uses: pypa/[email protected]
uses: pypa/[email protected]
# Windows takes forever to build so this needs to be >20min
timeout-minutes: 45
with:
package-dir: python
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ tests/Testing/Temporary/
python/zef/pyzef.pyd
core/CMakeSettings.json
/python/zef/auth.html
/python/tests/robot/log.html
/python/tests/robot/output.xml
/python/tests/robot/report.html
Loading

0 comments on commit 4528057

Please sign in to comment.