Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move common steps to run tox env into reusable workflow #247

Merged
merged 4 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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