Skip to content

Commit

Permalink
Move common steps to run tox env to reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverholworthy committed Mar 16, 2023
1 parent 2220707 commit 9234e17
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 170 deletions.
34 changes: 5 additions & 29 deletions .github/workflows/cpu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,13 @@ 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]
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.tox-env }} -- $branch

0 comments on commit 9234e17

Please sign in to comment.