Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

ci: workaround for the cache bug on Linux #11568

Merged
merged 21 commits into from
Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from 18 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
20 changes: 15 additions & 5 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@master
denisgranha marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 50
- name: Checkout submodules
shell: bash
run: git submodule update --init --recursive
submodules: true
# https://github.com/actions/cache/issues/133
- name: Fixup the owner of ~/.cargo/
denisgranha marked this conversation as resolved.
Show resolved Hide resolved
if: matrix.platform == 'ubuntu-16.04'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will probably also want to do this on macOS.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to be a problem for macOS.
Github uses a third-party service for macOS runners: https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#cloud-hosts-for-github-hosted-runners as opposed to Standard_DS2_v2 VMs on Asure for Linux and Windows.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Fixup the owner of C:\Users\runneradmin\.cargo\registry
if: matrix.platform == 'windows-latest'
shell: powershell
run: |
$registryPath = "C:\Rust\.cargo\registry"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use

Suggested change
$registryPath = "C:\Rust\.cargo\registry"
$registryPath = "$CARGO_HOME\registry"

to be more resillient against changes to the path? (Not sure if it is correct powershell syntax)

$acl = Get-Acl $registryPath
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("runneradmin","FullControl","ContainerInherit,ObjectInherit", "None", "Allow")
$acl.SetAccessRule($accessRule)
$acl | Set-Acl $registryPath
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
fetch-depth: 50
uses: actions/checkout@master
# https://github.com/actions/cache/issues/133
- name: Fixup the owner of ~/.cargo/
if: matrix.platform == 'ubuntu-16.04'
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-16.04
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@master
with:
fetch-depth: 50
- name: Checkout submodules
shell: bash
run: git submodule update --init --recursive
submodules: true
# https://github.com/actions/cache/issues/133
- name: Fixup the owner of ~/.cargo/
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down