Skip to content

Commit 3818b0e

Browse files
Merge branch 'rule-2ee8b8-may-2023' of https://github.com/dan-tripp-siteimprove/act-rules.github.io into rule-2ee8b8-may-2023
2 parents 903ee9d + 8ea29b6 commit 3818b0e

143 files changed

Lines changed: 1267 additions & 1181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/ACCESSIBILITY_SUPPORT.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ assignees: ''
1414

1515
- ... List the rules here, link to its acc support section
1616

17-
## Test cases
17+
## Examples
1818

19-
### Test case 1 ...
19+
### Example 1 ...
2020

21-
(( Add test case here ))
21+
(( Add example here ))
2222

2323
```html
2424
code snippet here
2525
```
2626

27-
[Open this test case]()
27+
[Open this example]()
2828

29-
(( Add a link to a code pen or other hosted test case. Keep in mind this test case needs to be accessible and persistent. ))
29+
(( Add a link to a code pen or other hosted example. Keep in mind this example needs to be accessible and persistent. ))
3030

3131
#### Preconditions
3232

@@ -39,12 +39,12 @@ Before running the test, check your settings. In many cases default settings are
3939

4040
#### Test instructions
4141

42-
(( Provide instructions on how to test the test case, this should include: ))
42+
(( Provide instructions on how to test the example, this should include: ))
4343

4444
- Which technologies to use
4545
- Any setting changes necessary to run the test
4646
- Any variation in how to operate the different assistive technologies
47-
- Step by step instructions on how to check the test case
47+
- Step by step instructions on how to check the example
4848
- What the expected results are
4949

5050
### External links

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Need for Call for Review:
99
<< check [Process Document on Call for Review](https://act-rules.github.io/pages/design/process/#call-for-review) >>
1010
This can be merged with 1 approval << choose reason: editorial changes to website/test code, adding new contributor, other (explain). >>
1111
This will not require a Call for Review << choose reason(s): editorial changes (including to the applicability, expectation or examples section), changes to assumptions, background, accessibility support, change to website/test code (not rule), other (explain). >>
12-
This will require a 1 week Call for Review << small changes affecting a small number of test cases, if in doubt do not use this. >>
13-
This will require a 2 weeks Call for Review << new rule, or substantial changes affecting a large number of test cases, if in doubt, use this. >>
12+
This will require a 1 week Call for Review << small changes affecting a small number of examples, if in doubt do not use this. >>
13+
This will require a 2 weeks Call for Review << new rule, or substantial changes affecting a large number of examples, if in doubt, use this. >>
1414

1515
---
1616

.github/scripts/approve-rule.mjs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (!argv['skip-clone']) {
2424
await createOrCheckoutBranch(config, argv.branch);
2525
await generateApprovedRulePages(config, argv.ruleId);
2626
await updateRuleVersionsYaml(config, argv.ruleId);
27-
await approveTestCaseJson(config, argv.ruleId);
27+
await approveexampleJson(config, argv.ruleId);
2828
await commitAndPush(config, `Set ${argv.ruleId} to approved`);
2929

3030
async function generateApprovedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }, ruleId) {
@@ -67,17 +67,17 @@ async function updateRuleVersionsYaml({ tmpDir }, ruleId) {
6767
console.log(`Added ${ruleId} to rule-versions.yml`);
6868
}
6969

70-
async function approveTestCaseJson({ tmpDir }, ruleId) {
71-
let testCaseCount = 0;
72-
const testCaseJsonPath = `${tmpDir}content-assets/wcag-act-rules/testcases.json`;
73-
const testCaseJson = JSON.parse(fs.readFileSync(testCaseJsonPath, 'utf8'));
74-
testCaseJson.testcases.forEach((testCase, index) => {
75-
if (testCase.ruleId === ruleId) {
70+
async function approveexampleJson({ tmpDir }, ruleId) {
71+
let exampleCount = 0;
72+
const exampleJsonPath = `${tmpDir}content-assets/wcag-act-rules/examples.json`;
73+
const exampleJson = JSON.parse(fs.readFileSync(exampleJsonPath, 'utf8'));
74+
exampleJson.examples.forEach((example, index) => {
75+
if (example.ruleId === ruleId) {
7676
// Override rather than update so that `approved` isn't at the bottom
77-
testCaseJson.testcases[index] = { ruleId, approved: true, ...testCase }
78-
testCaseCount++
77+
exampleJson.examples[index] = { ruleId, approved: true, ...example }
78+
exampleCount++
7979
}
8080
});
81-
console.log(`Set ${testCaseCount} test cases of rule ${ruleId} to be approved in testcases.json`);
82-
fs.writeFileSync(testCaseJsonPath, JSON.stringify(testCaseJson, null, 2), 'utf8');
81+
console.log(`Set ${exampleCount} examples of rule ${ruleId} to be approved in examples.json`);
82+
fs.writeFileSync(exampleJsonPath, JSON.stringify(exampleJson, null, 2), 'utf8');
8383
}

.github/scripts/pr-preview.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'
44

55
await cloneWcagActRules(config);
66
await generateProposedRulePages(config);
7-
await generateTestCases(config);
7+
await generateexamples(config);
88
// const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
99
// await commitAndPush(config, commitMessage);
1010

@@ -18,7 +18,7 @@ async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAs
1818
`;
1919
}
2020

21-
async function generateTestCases({ tmpDir, rulesDir, testAssetsDir }) {
21+
async function generateexamples({ tmpDir, rulesDir, testAssetsDir }) {
2222
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \
2323
--rulesDir "${rulesDir}" \
2424
--testAssetsDir "${testAssetsDir}" \

.github/scripts/wai-build.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'
44

55
await cloneWcagActRules(config);
66
await generateProposedRulePages(config);
7-
await generateTestCases(config);
7+
await generateexamples(config);
88
const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
99
await commitAndPush(config, commitMessage);
1010

@@ -18,7 +18,7 @@ async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAs
1818
`;
1919
}
2020

21-
async function generateTestCases({ tmpDir, rulesDir, testAssetsDir }) {
21+
async function generateexamples({ tmpDir, rulesDir, testAssetsDir }) {
2222
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \
2323
--rulesDir "${rulesDir}" \
2424
--testAssetsDir "${testAssetsDir}" \

.github/workflows/approve-rule.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ jobs:
1414
dispatch:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v6
1818
- name: Check user permission
1919
uses: 74th/workflow-permission-action@1.0.0
2020
with:
2121
listfile: .github/workflows/chair-accounts.md
22-
- uses: actions/setup-node@v3
22+
- uses: actions/setup-node@v6
2323
with:
24-
node-version: '16'
24+
node-version: '24'
2525
cache: npm
26-
- uses: actions/cache@v3
26+
- uses: actions/cache@v5
2727
with:
2828
path: ~/.npm
2929
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.github/workflows/dispatch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
dispatch:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-node@v3
15+
- uses: actions/checkout@v6
16+
- uses: actions/setup-node@v6
1717
with:
18-
node-version: 16
18+
node-version: 24
1919
cache: npm
2020
- run: |
2121
curl -XPOST -u "${{ secrets.USER_NAME }}:${{ secrets.USER_PAT }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/act-rules/act-rules-web/dispatches --data '{ "event_type": "build_application" }'

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
publish:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v6
1515
with:
1616
ref: 'master'
17-
- uses: actions/setup-node@v3
17+
- uses: actions/setup-node@v6
1818
with:
19-
node-version: 16
19+
node-version: 24
2020
cache: npm
2121
- run: |
2222
git config user.name "${{ secrets.USER_NAME }}"

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
test:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
20-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v6
20+
- uses: actions/setup-node@v6
2121
with:
22-
node-version: 16
22+
node-version: 24
2323
cache: npm
2424
- run: |
2525
npm install

.github/workflows/wai-deploy.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
dispatch:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-node@v3
12+
- uses: actions/checkout@v6
13+
- uses: actions/setup-node@v6
1414
with:
15-
node-version: '16'
15+
node-version: '24'
1616
cache: npm
17-
- uses: actions/cache@v3
17+
- uses: actions/cache@v5
1818
with:
1919
path: ~/.npm
2020
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@@ -23,6 +23,9 @@ jobs:
2323
- run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
2424
- name: Install dependencies
2525
run: npm ci
26+
# Since we control this we can safely just always use the latest
27+
- name: Install act-tools latest
28+
run: npm install github:act-rules/act-tools#main
2629
- name: Configure git
2730
run: |
2831
git config --global url."https://${{ secrets.WAI_GIT_NAME }}:${{ secrets.WAI_GIT_ACCESS_TOKEN }}@github.com".insteadOf "https://github.com"

0 commit comments

Comments
 (0)