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

Issue 800 windows ci use checkout #801

Merged
merged 6 commits into from
Nov 13, 2019
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
17 changes: 3 additions & 14 deletions .github/docker/rez-win-py/entrypoint.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#
# Entrypoint that installs given python version and runs tests from commit.
# Entrypoint that installs given python version and runs tests.
#
# $repo is the repository like 'nerdvegas/rez'
# $commit is the revision to test
param( $repo, $commit )

# Stop on errors; .exe has to be checked manually
Set-StrictMode -Version latest
$ErrorActionPreference = "Stop"

echo "Testing $repo at $commit"

# Fixes encoding issue on Windows 10 local docker run.
#
${ENV:PYTHONIOENCODING} = "UTF-8"
Expand All @@ -33,16 +28,10 @@ if (-not $?) {exit 1}
git --version
if (-not $?) {exit 1}

# Clone repo
git clone https://github.com/$repo rez
if (-not $?) {exit 1}
cd rez
git checkout $commit
if (-not $?) {exit 1}

# Install rez
# Note that the workflow's checkout has been bind mounted to /checkout
mkdir build
python install.py build
python .\checkout\install.py build
if (-not $?) {exit 1}

# Run Rez Tests
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/windows-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
# TODO: Represent the conditional build as steps?
# https://gh.neting.ccmunity/t5/GitHub-Actions/Fallback-via-if-failure-without-failing-the-job/m-p/36596#M2636
#
# By using dockers experimental CLI features we don't need to pull an
# image to check if it exists.
- uses: actions/checkout@v1
- name: Checkout
uses: actions/checkout@v1

- name: Build docker image if needed
run: |
${Env:LAST_DOCKER_BASE_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8)
Expand All @@ -60,6 +60,8 @@ jobs:
docker push ${gh_user}/rez-win-base:${ENV:LAST_DOCKER_BASE_REVISION}
}
env:
# By using dockers experimental CLI features we don't need to pull an
# image to check if it exists.
DOCKER_CLI_EXPERIMENTAL: enabled

# ----------------------------------------------------------------------------
Expand All @@ -85,7 +87,9 @@ jobs:
${gh_user} = ("${{ github.repository }}" -Split '/')[0]
'${{ secrets.DOCKERHUB_TOKEN }}' | docker login -u ${gh_user} --password-stdin

- uses: actions/checkout@v1
- name: Checkout
uses: actions/checkout@v1

- name: Pull base docker image
run: |
${Env:LAST_DOCKER_BASE_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
run: |
${gh_user} = ("${{ github.repository }}" -Split '/')[0]
${Env:LAST_DOCKER_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-py\ .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8)
docker run ${gh_user}/rez-win-py:${{ matrix.python-version }}-${Env:LAST_DOCKER_REVISION} ${{ github.repository }} ${{ github.sha }}
docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${gh_user}/rez-win-py:${{ matrix.python-version }}-${Env:LAST_DOCKER_REVISION}