Skip to content

Commit

Permalink
feat(datasource/github-runners): add macos 14 beta (#27292)
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
  • Loading branch information
viceice and HonkingGoose committed Feb 14, 2024
1 parent 57ba14f commit 7948907
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
42 changes: 41 additions & 1 deletion lib/modules/datasource/github-runners/index.spec.ts
Expand Up @@ -3,7 +3,7 @@ import { GithubRunnersDatasource } from '.';

describe('modules/datasource/github-runners/index', () => {
describe('getReleases', () => {
it('returns releases if package is known', async () => {
it('returns releases for Ubuntu', async () => {
const res = await getPkgReleases({
datasource: GithubRunnersDatasource.id,
packageName: 'ubuntu',
Expand All @@ -16,6 +16,46 @@ describe('modules/datasource/github-runners/index', () => {
{ version: '20.04' },
{ version: '22.04' },
],
sourceUrl: 'https://github.com/actions/runner-images',
});
});

it('returns releases for macOS', async () => {
const res = await getPkgReleases({
datasource: GithubRunnersDatasource.id,
packageName: 'macos',
});

expect(res).toMatchObject({
releases: [
{ version: '10.15', isDeprecated: true },
{ version: '11', isDeprecated: true },
{ version: '12-large' },
{ version: '12' },
{ version: '13-xlarge' },
{ version: '13-large' },
{ version: '13' },
{ version: '14-xlarge', isStable: false },
{ version: '14-large', isStable: false },
{ version: '14', isStable: false },
],
sourceUrl: 'https://github.com/actions/runner-images',
});
});

it('returns releases for Windows', async () => {
const res = await getPkgReleases({
datasource: GithubRunnersDatasource.id,
packageName: 'windows',
});

expect(res).toMatchObject({
releases: [
{ version: '2016', isDeprecated: true },
{ version: '2019' },
{ version: '2022' },
],
sourceUrl: 'https://github.com/actions/runner-images',
});
});

Expand Down
3 changes: 3 additions & 0 deletions lib/modules/datasource/github-runners/index.ts
Expand Up @@ -16,6 +16,9 @@ export class GithubRunnersDatasource extends Datasource {
{ version: '16.04', isDeprecated: true },
],
macos: [
{ version: '14', isStable: false },
{ version: '14-large', isStable: false },
{ version: '14-xlarge', isStable: false },
{ version: '13' },
{ version: '13-large' },
{ version: '13-xlarge' },
Expand Down
23 changes: 18 additions & 5 deletions lib/modules/datasource/github-runners/readme.md
@@ -1,11 +1,24 @@
This datasource returns a list of all _stable_ runners that are hosted by GitHub.
This datasource ignores beta releases.
This datasource returns a list of all runners that are hosted by GitHub.
The datasource is based on [GitHub's `runner-images` repository](https://github.com/actions/runner-images).

Examples: `windows-2019` / `ubuntu-22.04` / `macos-13`
Examples: `windows-2022` / `ubuntu-22.04` / `macos-13`

## Maintenance

New _stable_ runner versions must be added to the datasource with a pull request.
Unstable runners are tagged as `[beta]` in the readme of the [`runner-images` repository](https://github.com/actions/runner-images).
### Adding a new version

New runner versions must be added to the datasource with a pull request.

#### Unstable runners

Unstable runners are tagged as `[beta]` in [the `runner-images` repository's readme](https://github.com/actions/runner-images) and should get the `isStable:false` property in our code.

#### Promoting a version to stable

Once a runner version becomes stable, the `[beta]` tag is removed and the suffix `latest` is added to its YAML label.
We then remove the `isStable:false` property in our code.

### Deprecating a version

Deprecated runners are tagged as `[deprecated]` in [the `runner-images` repository's readme](https://github.com/actions/runner-images) and we should give it the `isDeprecated:true` property.
If a runner is very old, the readme may drop it completely, but we should still give it the `isDeprecated:true` property.

0 comments on commit 7948907

Please sign in to comment.