Skip to content

Commit

Permalink
Publish two packages (microsoft#106)
Browse files Browse the repository at this point in the history
* Move existing code into hi-ml-azure
* Create new package in hi-ml
* Create top level files
  • Loading branch information
JonathanTripp committed Sep 22, 2021
1 parent 46b2d3f commit 3cac37f
Show file tree
Hide file tree
Showing 75 changed files with 8,054 additions and 358 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
COPY build_requirements.txt run_requirements.txt test_requirements.txt /tmp/conda-tmp/
COPY build_requirements.txt test_requirements.txt /tmp/conda-tmp/
COPY hi-ml-azure/run_requirements.txt /tmp/conda-tmp/hi-ml-azure/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp

Expand Down
59 changes: 59 additions & 0 deletions .github/actions/download_package_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Download package artifacts'
description: 'Download and parse all package artifacts'
inputs:
folder: # id of input
description: 'Target folder'
required: true
package_type:
description: 'Package type'
required: false
default: '*.whl'
outputs:
package_filename:
description: 'Package filename'
value: ${{ steps.set_output.outputs.package_filename }}
package_name:
description: 'Package name'
value: ${{ steps.set_output.outputs.package_name }}
latest_version:
description: 'Latest version'
value: ${{ steps.set_output.outputs.latest_version }}
package_version:
description: 'Package version string'
value: ${{ steps.set_output.outputs.package_version }}
runs:
using: "composite"
steps:
- name: Download distribution artifact
uses: actions/download-artifact@v2
with:
name: ${{ inputs.folder }}${{ env.HIML_DIST_ARTIFACT_SUFFIX }}
path: ${{ inputs.folder }}/dist

- name: Download package name artifact
uses: actions/download-artifact@v2
with:
name: ${{ inputs.folder }}${{ env.HIML_PACKAGE_NAME_ARTIFACT_SUFFIX }}
path: ${{ inputs.folder }}

- name: Download version artifact
uses: actions/download-artifact@v2
with:
name: ${{ inputs.folder }}${{ env.HIML_VERSION_ARTIFACT_SUFFIX }}
path: ${{ inputs.folder }}

- name: Set output
id: set_output
shell: bash
run: |
cd ${{ inputs.folder }}
package_filename=$(find dist -name ${{ inputs.package_type }})
package_name=$(cat ./package_name.txt)
latest_version=$(cat ./latest_version.txt)
package_version=$package_name==$latest_version
echo "::set-output name=package_filename::$package_filename"
echo "::set-output name=package_name::$package_name"
echo "::set-output name=latest_version::$latest_version"
echo "::set-output name=package_version::$package_version"
15 changes: 15 additions & 0 deletions .github/actions/format_coverage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Format coverage action

This action loads the file coverage.txt produced by pytest-cov, formats it as an HTML table, and adds it to the commit as a comment.

## Build

Following the instructions: [https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action):

1. Install nodejs and npm

1. Install vercel/ncc by running this command in your terminal. npm i -g @vercel/ncc

1. Compile your index.js file. ncc build index.js --license licenses.txt

You'll see a new dist/index.js file with your code and the compiled modules. You will also see an accompanying dist/licenses.txt file containing all the licenses of the node_modules you are using.
12 changes: 12 additions & 0 deletions .github/actions/format_coverage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'format_coverage'
description: 'Format pytest-cov report for github comment'
inputs:
file: # id of input
description: 'Coverage.txt file name'
required: true
token: # id of input
description: 'Token with access to your repository'
required: true
runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit 3cac37f

Please sign in to comment.