diff --git a/.github/workflows/axe-a11y-check.yml b/.github/workflows/axe-a11y-check.yml new file mode 100644 index 000000000..a180dd53d --- /dev/null +++ b/.github/workflows/axe-a11y-check.yml @@ -0,0 +1,34 @@ +name: axe +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop +jobs: + axe: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x] + + steps: + - uses: actions/checkout@v2 + - name: Install wait-on + run: npm install --save wait-on + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm ci + - run: npm run build --if-present + - run: npm start & npx wait-on http://localhost:4010 + - name: Run axe + run: | + echo "Running axe-core accessibility checks..." + npm install -g @axe-core/cli + axe http://localhost:4010 --exit diff --git a/package.json b/package.json index 83f457b01..871b69772 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,14 @@ "description": "", "scripts": { "test": "mocha test --recursive", + "start": "http-server landing -p 4010", "lint": "eslint ./core/*.js ./components/**/*.js ./common/smartpen/*.js ./apps/*.js ./apps/port/*.js ./apps/heatmap/*.js ./apps/multi/*.js ./apps/labeling/*.js ./apps/loader/*.js ./apps/model/*.js ./apps/segment/*.js ./apps/model/**/*.js ./apps/segment/**/*.js ./apps/viewer/*.js --quiet", "lint-fix": "eslint ./core/*.js ./components/**/*.js ./common/smartpen/*.js ./apps/*.js ./apps/port/*.js ./apps/heatmap/*.js ./apps/multi/*.js ./apps/labeling/*.js ./apps/loader/*.js ./apps/model/*.js ./apps/segment/*.js ./apps/model/**/*.js ./apps/segment/**/*.js ./apps/viewer/*.js --quiet --fix" }, "author": "", "license": "BSD-3-Clause", "dependencies": { + "http-server": "^0.12.3", "chai": "^4.3.7", "eslint": "^6.8.0", "eslint-config-google": "^0.14.0",