Skip to content

Commit

Permalink
pipe-generateWcag update to use local file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgldvd committed Nov 9, 2024
1 parent e891389 commit 63a5961
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
34 changes: 15 additions & 19 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,34 @@ jobs:
with:
python-version: '3.x'

- name: Install Python dependencies
- name: 🏅 Install Python dependencies
run: pip install -r requirements.txt

- name: Run Python scripts
run: |
echo 🏅 - Generate JSON
python tools/pipe-generateJson.py
- name: 🏅 Run Python scripts
run: python tools/pipe-generateJson.py

echo 🏅 - Generate JSON files
python tools/pipe-generateJsonFiles.py
- name: 🏅 Generate JSON files
run: python tools/pipe-generateJsonFiles.py

echo 🏅 - Generate CSV
python tools/pipe-generateCsv.py
- name: 🏅 Generate CSV
run: python tools/pipe-generateCsv.py

echo 🏅 - Generate Installers
python tools/pipe-generateShFiles.py
- name: 🏅 Generate Installers
run: python tools/pipe-generateShFiles.py

echo 🏅 - Update themes in Gogh file
python tools/pipe-updateThemes.py
- name: 🏅 Update themes in Gogh file
run: python tools/pipe-updateThemes.py

echo 🏅 - Pipeline run date
python tools/pipe.py
- name: 🏅 Pipeline run date
run: python tools/pipe.py

- name: Set up Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Run WCAG generator script with Deno
run: |
echo 🏅 - Running WCAG generator script
deno run --allow-all tools/pipe-generateWcag.js
- name: 🏅 Run WCAG generator script with Deno
run: deno run --allow-all tools/pipe-generateWcag.js

- name: Commit and push changes
env:
Expand Down
1 change: 0 additions & 1 deletion dist

This file was deleted.

4 changes: 1 addition & 3 deletions tools/pipe-generateWcag.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { ratio, score } from 'npm:wcag-color';
import axios from 'npm:axios';
import fs from 'node:fs';

async function generateReport() {
const response = await axios.get('https://raw.githubusercontent.com/Gogh-Co/Gogh/master/data/themes.json');
const themes = response.data;
const themes = JSON.parse(fs.readFileSync('data/themes.json', 'utf-8'));

const report = themes.map(theme => {
const background = theme.background;
Expand Down

0 comments on commit 63a5961

Please sign in to comment.