Skip to content

Commit

Permalink
make test.yml workflow call test-windows.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Aug 3, 2023
1 parent 7f6949a commit 95b6d96
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 31 deletions.
5 changes: 3 additions & 2 deletions .github/actions/build-windows-image/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: "Build Windows images"
description: "Builds wcow images with MSVC and CUDA"
name: Build Windows images

description: Builds wcow images with MSVC and CUDA

inputs:
repo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
build-all-images:
name: Build Windows images
name: Windows
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/get-repo-version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: get-repo-version
name: Get repository version

on:
workflow_call:
Expand Down
60 changes: 33 additions & 27 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,50 @@
name: Test Windows

concurrency:
group: test-windows-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true

on:
pull_request:
paths: [.github/**/*windows*, scripts/windows/**]
push:
paths: [.github/**/*windows*, scripts/windows/**]
branches:
- "pull-request/[0-9]+"
workflow_call:

jobs:
check-event:
name: Check PR Event
version-and-changes:
name: Check if files changed and get repo version
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check_pr_event.outputs.ok }}
any_changed: ${{ steps.changes.outputs.any_changed }}
repo_version: ${{ steps.version.outputs.repo_version }}
steps:
- id: check_pr_event
name: Check PR Event
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- id: get-pr-info
if: inputs.full_matrix != 'true'
name: Get PR target branch info
uses: ./.github/actions/get-pr-info

- id: version
name: Get the repository version from the closest git tag
shell: bash
run: |
[[ '${{ github.event_name }}' == 'push' && '${{ github.repository }}' == 'rapidsai/devcontainers' ]] || \
[[ '${{ github.event_name }}' == 'pull_request' && '${{ github.repository }}' != 'rapidsai/devcontainers' ]] \
&& echo "ok=true" | tee -a $GITHUB_OUTPUT \
|| echo "ok=false" | tee -a $GITHUB_OUTPUT;
cat <<EOF | tee "$GITHUB_OUTPUT"
repo_version=$(git describe --abbrev=0 --tags | sed 's/[a-zA-Z]//g' | cut -d '.' -f -2)
EOF
version:
needs: check-event
if: needs.check-event.outputs.ok == 'true'
name: Get repository version
uses: ./.github/workflows/get-repo-version.yml
- id: changes
name: Check if files changed
if: inputs.full_matrix != 'true'
uses: tj-actions/changed-files@v35.4.4
with:
base_sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}
files: |
.github/**/*windows*
scripts/windows/**
dispatch:
needs: version
name: Build Windows images
needs: version-and-changes
if: needs.version-and-changes.outputs.any_changed == 'true'
uses: ./.github/workflows/dispatch-windows.yml
secrets: inherit
with:
push_image: false
repo_version: ${{ needs.version.outputs.repo_version }}
repo_version: ${{ needs.version-and-changes.outputs.repo_version }}
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
&& echo "ok=true" | tee -a $GITHUB_OUTPUT \
|| echo "ok=false" | tee -a $GITHUB_OUTPUT;
test-windows:
if: needs.check-event.outputs.ok == 'true'
name: Test Windows
needs: check-event
secrets: inherit
uses: ./.github/workflows/test-windows.yml

validate-features-json:
if: needs.check-event.outputs.ok == 'true'
name: Validate features
Expand Down

0 comments on commit 95b6d96

Please sign in to comment.