Skip to content

Commit

Permalink
chore(ci): use windows-2022 runner on skipped release job on PRs (den…
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jan 13, 2023
1 parent 3d423e1 commit e09d298
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts";

const windowsRunnerCondition =
"github.repository == 'denoland/deno' && 'windows-2022-xl' || 'windows-2022'";
const Runners = {
linux:
"${{ github.repository == 'denoland/deno' && 'ubuntu-20.04-xl' || 'ubuntu-20.04' }}",
macos: "macos-12",
windows:
"${{ github.repository == 'denoland/deno' && 'windows-2022-xl' || 'windows-2022' }}",
windows: `\${{ ${windowsRunnerCondition} }}`,
};

const installPkgsCommand =
Expand Down Expand Up @@ -200,7 +201,7 @@ const ci = {
jobs: {
build: {
name: "${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}",
"runs-on": "${{ matrix.os }}",
"runs-on": "${{ matrix.runner || matrix.os }}",
"timeout-minutes": 120,
strategy: {
matrix: {
Expand All @@ -223,6 +224,9 @@ const ci = {
},
{
os: Runners.windows,
// use a free runner on PRs since this will be skipped
runner:
`\${{ github.event_name == 'pull_request' && 'windows-2022' || (${windowsRunnerCondition}) }}`,
job: "test",
profile: "release",
skip_pr: true,
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:
jobs:
build:
name: '${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}'
runs-on: '${{ matrix.os }}'
runs-on: '${{ matrix.runner || matrix.os }}'
timeout-minutes: 120
strategy:
matrix:
Expand All @@ -35,6 +35,7 @@ jobs:
job: test
profile: fastci
- os: '${{ github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}'
runner: '${{ github.event_name == ''pull_request'' && ''windows-2022'' || (github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'') }}'
job: test
profile: release
skip_pr: true
Expand Down

0 comments on commit e09d298

Please sign in to comment.