Skip to content

Commit 5a6c9fb

Browse files
authored
V3.0 release (#39)
* v3.0: Upgrade to Node 24 and modernize codebase * update actions versions referenced in README * major version numbers
1 parent cab60f8 commit 5a6c9fb

17 files changed

+119121
-116543
lines changed

.eslintrc.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,41 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 3.0 (2026-03-24)
6+
7+
> **_BREAKING CHANGES_**
8+
>
9+
> Action runtime upgraded from `node20` to `node24`. This requires GitHub Actions runners with Node.js 24 support.
10+
11+
### Features
12+
13+
* Upgraded action runtime from `node20` to `node24`
14+
15+
### Maintenance
16+
17+
* Modernized codebase to ES modules (internal change)
18+
* Upgraded all dependencies to latest versions
19+
* `@actions/core` to v3.0.0
20+
* `@actions/github` to v9.0.0
21+
* `@aws-sdk/client-device-farm` to v3.1015.0
22+
* `axios` to v1.13.6
23+
* Removed `fast-xml-parser` security override (resolved in dependency updates)
24+
* Switched build toolchain from `@vercel/ncc` to `rollup` (following GitHub's official documentation)
25+
* Migrated test framework from Jest to Vitest for native ES modules support
26+
* Updated ESLint to v10 with new flat config format
27+
* All tests passing with 100% code coverage
28+
529
## 2.3 (2024-08-14)
630

731
> Fixed dependabot security finding [#7](https://github.com/aws-actions/aws-devicefarm-mobile-device-testing/security/dependabot/7).
832
9-
1033
## 2.2 (2024-07-30)
1134

1235
> Fixed dependabot security finding [#6](https://github.com/aws-actions/aws-devicefarm-mobile-device-testing/security/dependabot/6).
1336
14-
1537
## 2.1 (2024-06-04)
1638

17-
> Fixed bug identified in issue [#8](#8) where `configuration` section in `run-settings-json` could not be excluded.
39+
> Fixed bug identified in issue [#8](https://github.com/aws-actions/aws-devicefarm-mobile-device-testing/issues/8) where `configuration` section in `run-settings-json` could not be excluded.
1840
1941
## 2.0 (2023-10-13)
2042

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ For example, testing new versions of code being committed to a branch to ensure
6060
6161
```yaml
6262
- name: Checkout repo
63-
uses: actions/checkout@v3
63+
uses: actions/checkout@v6
6464

6565
- name: Configure AWS credentials
66-
uses: aws-actions/configure-aws-credentials@v2 # More information on this action can be found below in the 'AWS Credentials' section
66+
uses: aws-actions/configure-aws-credentials@v6 # More information on this action can be found below in the 'AWS Credentials' section
6767
with:
6868
role-to-assume: arn:aws:iam::123456789012:role/my-github-actions-role
6969
aws-region: us-west-2
@@ -74,7 +74,7 @@ For example, testing new versions of code being committed to a branch to ensure
7474
```yaml
7575
- name: Schedule Device Farm Automated Test
7676
id: run-test
77-
uses: aws-actions/aws-devicefarm-mobile-device-testing@v2.0
77+
uses: aws-actions/aws-devicefarm-mobile-device-testing@v3
7878
with:
7979
run-settings-json: |
8080
{
@@ -90,7 +90,7 @@ For example, testing new versions of code being committed to a branch to ensure
9090
}
9191
artifact-types: ALL
9292

93-
- uses: actions/upload-artifact@v3
93+
- uses: actions/upload-artifact@v7
9494
if: always() # This ensures the artifacts are uploaded even if the Test Run Fails
9595
with:
9696
name: AutomatedTestOutputFiles
@@ -102,7 +102,7 @@ For example, testing new versions of code being committed to a branch to ensure
102102
```yaml
103103
- name: Schedule Device Farm Automated Test
104104
id: run-test
105-
uses: aws-actions/aws-devicefarm-mobile-device-testing@v2.0
105+
uses: aws-actions/aws-devicefarm-mobile-device-testing@v3
106106
with:
107107
run-settings-json: |
108108
{
@@ -118,7 +118,7 @@ For example, testing new versions of code being committed to a branch to ensure
118118
}
119119
artifact-types: VIDEO,SCREENSHOT
120120

121-
- uses: actions/upload-artifact@v3
121+
- uses: actions/upload-artifact@v7
122122
if: always() # This ensures the artifacts are uploaded even if the Test Run Fails
123123
with:
124124
name: AutomatedTestOutputFiles
@@ -130,7 +130,7 @@ For example, testing new versions of code being committed to a branch to ensure
130130
```yaml
131131
- name: Schedule Device Farm Automated Test
132132
id: run-test
133-
uses: aws-actions/aws-devicefarm-mobile-device-testing@v2.0
133+
uses: aws-actions/aws-devicefarm-mobile-device-testing@v3
134134
with:
135135
run-settings-json: |
136136
{
@@ -156,14 +156,14 @@ This action relies on the [default behaviour of the AWS SDK for JavaScript](http
156156

157157
```yaml
158158
- name: Configure AWS credentials
159-
uses: aws-actions/configure-aws-credentials@v2
159+
uses: aws-actions/configure-aws-credentials@v6
160160
with:
161161
role-to-assume: arn:aws:iam::123456789012:role/my-github-actions-role
162162
aws-region: us-west-2
163163
164164
- name: Schedule Device Farm Automated Test
165165
id: run-test
166-
uses: aws-actions/aws-devicefarm-mobile-device-testing@v2.0
166+
uses: aws-actions/aws-devicefarm-mobile-device-testing@v3
167167
with:
168168
run-settings-json: |
169169
{

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ outputs:
5252
console-url:
5353
description: 'The AWS Console URL for the test run'
5454
runs:
55-
using: 'node20'
55+
using: 'node24'
5656
main: 'dist/index.js'
5757
post: 'dist/cleanup/index.js'

cleanup.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
const {
1+
import {
22
DeviceFarmClient,
33
paginateListUploads,
44
DeleteUploadCommand
5-
} = require("@aws-sdk/client-device-farm");
6-
const core = require("@actions/core");
7-
const github = require("@actions/github");
8-
const fs = require("fs/promises");
9-
const { existsSync } = require("fs");
10-
const { UPLOAD } = require("./constants");
5+
} from "@aws-sdk/client-device-farm";
6+
import * as core from "@actions/core";
7+
import * as github from "@actions/github";
8+
import fs from "fs/promises";
9+
import { existsSync } from "fs";
10+
import { UPLOAD } from "./constants.js";
1111

1212
const deviceFarm = new DeviceFarmClient();
1313

@@ -39,11 +39,11 @@ async function cleanup() {
3939
}
4040
}
4141

42-
module.exports = {
42+
export {
4343
cleanup
4444
};
4545

4646
/* istanbul ignore next */
47-
if (require.main === module) {
47+
if (import.meta.url === `file://${process.argv[1]}`) {
4848
cleanup();
4949
}

cleanup.test.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
const { cleanup } = require("./cleanup.js");
2-
const {
1+
import { vi } from "vitest";
2+
import { cleanup } from "./cleanup.js";
3+
import {
34
DeviceFarmClient,
45
ListUploadsCommand,
56
DeleteUploadCommand
6-
} = require("@aws-sdk/client-device-farm");
7-
const core = require("@actions/core");
8-
const github = require("@actions/github");
9-
const fs = require("fs/promises");
10-
const { UPLOAD } = require("./constants");
11-
const { mockClient } = require("aws-sdk-client-mock");
12-
require("aws-sdk-client-mock-jest");
13-
const mock = require("mock-fs");
14-
15-
jest.mock("@actions/core");
16-
jest.mock("@actions/github", () => ({
7+
} from "@aws-sdk/client-device-farm";
8+
import * as core from "@actions/core";
9+
import * as github from "@actions/github";
10+
import fs from "fs/promises";
11+
import { UPLOAD } from "./constants.js";
12+
import { mockClient } from "aws-sdk-client-mock";
13+
import "aws-sdk-client-mock-vitest";
14+
import mock from "mock-fs";
15+
16+
vi.mock("@actions/core");
17+
vi.mock("@actions/github", () => ({
1718
context: {
1819
runId: 1
1920
}
2021
}));
21-
jest.mock("fs/promises");
22+
vi.mock("fs/promises");
2223

2324
function mockGetState(requestResponse) {
2425
return function (name, options) { // eslint-disable-line no-unused-vars
@@ -36,8 +37,8 @@ const mockDeviceFarm = mockClient(DeviceFarmClient);
3637
describe("Cleanup", () => {
3738

3839
beforeEach(() => {
39-
jest.clearAllMocks();
40-
core.getState = jest.fn().mockImplementation(mockGetState(STATES));
40+
vi.clearAllMocks();
41+
core.getState = vi.fn().mockImplementation(mockGetState(STATES));
4142
mockDeviceFarm.reset();
4243
});
4344

@@ -86,10 +87,10 @@ describe("Cleanup", () => {
8687
await cleanup();
8788

8889
expect(github.context.runId).toBe(1);
89-
expect(mockDeviceFarm).toHaveReceivedNthSpecificCommandWith(1, ListUploadsCommand, {
90+
expect(mockDeviceFarm).toHaveReceivedCommandWith(ListUploadsCommand, {
9091
arn: "fake-project-arn"
9192
});
92-
expect(mockDeviceFarm).toHaveReceivedNthSpecificCommandWith(1, DeleteUploadCommand, {
93+
expect(mockDeviceFarm).toHaveReceivedCommandWith(DeleteUploadCommand, {
9394
arn: "fake-upload-arn-1"
9495
});
9596
expect(core.setFailed).toHaveBeenCalledTimes(0);

constants.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
const INPUTS = {
1+
export const INPUTS = {
22
runSettingsJson: "run-settings-json",
33
artifactTypes: "artifact-types",
44
uploadPollInterval: "upload-poll-interval",
55
runPollInterval: "run-poll-interval",
66
};
77

8-
const OUTPUTS = {
8+
export const OUTPUTS = {
99
arn: "arn",
1010
status: "status",
1111
result: "result",
1212
artifactFolder: "artifact-folder",
1313
consoleUrl: "console-url",
1414
};
1515

16-
const UPLOAD = {
16+
export const UPLOAD = {
1717
STATUS: {
1818
INITIALIZED: "INITIALIZED",
1919
PROCESSING: "PROCESSING",
@@ -26,7 +26,7 @@ const UPLOAD = {
2626
},
2727
};
2828

29-
const RUN = {
29+
export const RUN = {
3030
STATUS: {
3131
PENDING: "PENDING",
3232
PENDING_CONCURRENCY: "PENDING_CONCURRENCY",
@@ -53,10 +53,3 @@ const RUN = {
5353
"LOG",
5454
]
5555
};
56-
57-
module.exports = {
58-
INPUTS,
59-
OUTPUTS,
60-
UPLOAD,
61-
RUN,
62-
};

0 commit comments

Comments
 (0)