diff --git a/.github/workflows/test-cache-windows.yml b/.github/workflows/test-cache-windows.yml new file mode 100644 index 0000000..cf29ac0 --- /dev/null +++ b/.github/workflows/test-cache-windows.yml @@ -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 diff --git a/.github/workflows/test-latest-windows.yml b/.github/workflows/test-latest-windows.yml new file mode 100644 index 0000000..ca1ce1e --- /dev/null +++ b/.github/workflows/test-latest-windows.yml @@ -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 diff --git a/.github/workflows/test-latest.yml b/.github/workflows/test-latest.yml index 1bfde61..a179ec9 100644 --- a/.github/workflows/test-latest.yml +++ b/.github/workflows/test-latest.yml @@ -4,8 +4,6 @@ on: push: branches: - main - schedule: - - cron: "0 0 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }}