Skip to content

Commit e720964

Browse files
test: add action tests (#5)
1 parent fc6ef1e commit e720964

File tree

13 files changed

+170
-26
lines changed

13 files changed

+170
-26
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '34 4 * * 6'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v2
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v2
71+
continue-on-error: true

.github/workflows/test.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 0 1 * *" # 1 day of every month
10+
11+
jobs:
12+
test-macos:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [macos-11, macos-12, macos-13]
17+
record: [true, false]
18+
ignoreTccDb: [true, false]
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: 20
24+
- name: Guidepup Setup
25+
uses: ./
26+
with:
27+
record: ${{ matrix.record }}
28+
ignoreTccDb: ${{ matrix.ignoreTccDb }}
29+
- uses: actions/upload-artifact@v3
30+
if: always()
31+
with:
32+
name: artifacts
33+
path: |
34+
**/recordings/**/*
35+
36+
test-macos-14:
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
matrix:
40+
os: [macos-14]
41+
record: [true, false]
42+
ignoreTccDb: [true]
43+
steps:
44+
- uses: actions/checkout@v3
45+
- uses: actions/setup-node@v3
46+
with:
47+
node-version: 20
48+
- name: Guidepup Setup
49+
uses: ./
50+
with:
51+
record: ${{ matrix.record }}
52+
ignoreTccDb: ${{ matrix.ignoreTccDb }}
53+
- uses: actions/upload-artifact@v3
54+
if: always()
55+
with:
56+
name: artifacts
57+
path: |
58+
**/recordings/**/*
59+
60+
test-windows:
61+
runs-on: ${{ matrix.os }}
62+
strategy:
63+
matrix:
64+
os: [windows-2019, windows-2022]
65+
nvdaInstallDir: ["", "D:\\a\\setup-action\\setup-action\\nvda"]
66+
steps:
67+
- uses: actions/checkout@v3
68+
- uses: actions/setup-node@v3
69+
with:
70+
node-version: 20
71+
- name: Guidepup Setup
72+
uses: ./
73+
with:
74+
nvdaInstallDir: ${{ matrix.nvdaInstallDir }}
75+
- run: Get-ChildItem ${{ matrix.nvdaInstallDir }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ If updating the TCC.db is not possible (due to SIP) or required you can skip the
6060
```
6161

6262
> [!NOTE]
63-
> If the necessary permissions have not been granted by other means, using this flag may result in your environment not being setup for reliable screen reader automation.
63+
> If the necessary permissions have not been granted by other means, using this flag may result in your environment not being set up for reliable screen reader automation.
6464

6565
### Windows
6666

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
ignoreTccDb:
2121
description: "Ignore TCC.db updates if not possible or required for your environment. Default is not to ignore. macos agents only."
2222
required: false
23-
default: ""
23+
default: false
2424
nvdaInstallDir:
2525
description: "Specify a custom location for where to install NVDA. Default is to install to a temporary directory. windows agents only."
2626
required: false

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const exec = require("@actions/exec");
55

66
async function main() {
77
try {
8-
if (os.platform === "darwin") {
8+
if (os.platform() === "darwin") {
99
// Fix for GitHub actions macos-11 screencapture not working
1010
// REF: https://github.com/actions/runner-images/issues/5960
1111
const width = core.getInput("resolutionWidth") || "1920";
@@ -32,7 +32,7 @@ async function main() {
3232
}
3333
}
3434

35-
if (os.platform === "win32") {
35+
if (os.platform() === "win32") {
3636
const nvdaInstallDirectory = core.getInput("nvdaInstallDir") ?? null;
3737

3838
if (nvdaInstallDirectory) {
@@ -43,6 +43,7 @@ async function main() {
4343

4444
// Run generic screen reader setup
4545
process.argv.push("--ci");
46+
4647
require("@guidepup/setup");
4748
} catch (err) {
4849
core.setFailed(err);

node_modules/.yarn-integrity

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@guidepup/setup/README.md

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@guidepup/setup/lib/logging.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@guidepup/setup/lib/logging.js

Lines changed: 4 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@guidepup/setup/lib/macOS/setup.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)