Skip to content

Commit

Permalink
Add windows runners
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Jul 12, 2024
1 parent b0de59c commit e7e03c0
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/test-cache-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'test-cache-windows'
on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test-setup-cache:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup with cache
uses: ./
with:
enable-cache: true
working-directory: __tests__\fixtures\rye-project
cache-prefix: ${{ github.run_id }}-${{ github.run_attempt }}
- run: rye sync
working-directory: __tests__\fixtures\rye-project
test-restore-cache:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
needs: test-setup-cache
steps:
- uses: actions/checkout@v4
- name: Restore with cache
id: restore
uses: ./
with:
enable-cache: true
working-directory: __tests__\fixtures\rye-project
cache-prefix: ${{ github.run_id }}-${{ github.run_attempt }}
- name: Cache was hit
run: |
if ($env:CACHE_HIT -ne "true") {
exit 1
}
env:
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
- run: rye sync
working-directory: __tests__\fixtures\rye-project
49 changes: 49 additions & 0 deletions .github/workflows/test-latest-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'test-latest-windows'
on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test-latest:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Should not be on path
run: |
if (!(Get-Command -Name "rye" -ErrorAction SilentlyContinue)) {
exit 0
} else {
exit 1
}
- name: Setup rye
uses: ./
with:
version: latest
working-directory: __tests__\fixtures\rye-project
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: rye sync
working-directory: __tests__\fixtures\rye-project
- name: Rye path is not added to .profile
run: |
$env:Path -split ';' | ForEach-Object {
if ($_ -eq "C:\path\to\rye") {
exit 1
}
}
exit 0
test-latest-without-github-token:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup rye
uses: ./
with:
version: latest
- run: rye sync
working-directory: __tests__\fixtures\rye-project
2 changes: 0 additions & 2 deletions .github/workflows/test-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down

0 comments on commit e7e03c0

Please sign in to comment.