Skip to content

Commit

Permalink
Move common steps to run tox env into reusable workflow (#247)
Browse files Browse the repository at this point in the history
* Move common steps to run tox env to reusable workflow

* Add strategy and runs-on to CPU build

* Revert "Add strategy and runs-on to CPU build"

This reverts commit 2c9aad4.

---------

Co-authored-by: Karl Higley <karlb@nvidia.com>
  • Loading branch information
oliverholworthy and karlhigley authored Mar 21, 2023
1 parent 4b3ec51 commit d4f1c6e
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 170 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/cpu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,14 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
os: [ubuntu-latest]
uses: ./.github/workflows/tox.yml
with:
env: test-cpu

store-pr-information:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Ubuntu packages
run: |
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler
- name: Install and upgrade python packages
run: |
python -m pip install --upgrade pip setuptools==59.4.0 wheel tox
- name: Run tests
run: |
ref_type=${{ github.ref_type }}
branch=main
if [[ $ref_type == "tag"* ]]
then
raw=$(git branch -r --contains ${{ github.ref_name }})
branch=${raw/origin\/}
fi
tox -e test-cpu -- $branch
- name: Store PR information
run: |
mkdir ./pr
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/cpu-models.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/cpu-nvtabular.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/cpu-systems.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/merlin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Test Merlin"

on:
workflow_dispatch:
push:
branches: [main]
tags:
- v*
pull_request:
branches: [main]

jobs:
dataloader:
name: "Dataloader (CPU)"
uses: ./.github/workflows/tox.yml
with:
env: test-dataloader-cpu

systems:
name: "Systems (CPU)"
uses: ./.github/workflows/tox.yml
with:
env: test-systems-cpu

models:
name: "Models (CPU)"
uses: ./.github/workflows/tox.yml
with:
env: test-models-cpu

nvtabular:
name: "NVTabular (CPU)"
uses: ./.github/workflows/tox.yml
with:
env: test-nvtabular-cpu
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Dataloader Tests (CPU)
name: "Run Tox Env"

on:
workflow_dispatch:
push:
branches: [main]
tags:
- v*
pull_request:
branches: [main]
workflow_call:
inputs:
env:
description: "The name of the tox environment to run"
required: true
type: string

jobs:
check:
Expand Down Expand Up @@ -36,4 +35,4 @@ jobs:
- name: Run tests
run: |
branch="${{ steps.get-branch-name.outputs.branch }}"
GIT_COMMIT=`git rev-parse HEAD` tox -e test-dataloader-cpu -- $branch
GIT_COMMIT=`git rev-parse HEAD` tox -e ${{ inputs.env }} -- $branch

0 comments on commit d4f1c6e

Please sign in to comment.