diff --git a/.github/main.workflow b/.github/main.workflow index c7fe63c97..b73dc309c 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,7 +1,7 @@ workflow "Octicons" { on = "push" resolves = [ - "lint" + "test" ] } @@ -11,7 +11,27 @@ action "install" { } action "lint" { - needs = ["install"] uses = "actions/npm@master" args = "run lint" } + +action "test" { + needs = ["lint", "Figma Action"] + uses = "actions/npm@master" + args = "test" +} + +action "Figma Action" { + needs = ["install"] + uses = "primer/figma-action@master" + secrets = [ + "FIGMA_TOKEN" + ] + env = { + "FIGMA_FILE_URL" = "https://www.figma.com/file/FP7lqd1V00LUaT5zvdklkkZr/Octicons" + } + args = [ + "format=svg", + "dir=./lib/build" + ] +} diff --git a/package.json b/package.json index 5cb97cefb..a1f41f83d 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,6 @@ "test": "ava tests/*.js", "lint": "eslint tests" }, - "figma": { - "url": "https://www.figma.com/file/FP7lqd1V00LUaT5zvdklkkZr/Octicons" - }, "dependencies": { "ava": "^0.22.0", "eslint": "^5.8.0", diff --git a/tests/test-for-current-year.js b/tests/index.js similarity index 79% rename from tests/test-for-current-year.js rename to tests/index.js index 753fad869..8acdcf9b7 100644 --- a/tests/test-for-current-year.js +++ b/tests/index.js @@ -4,6 +4,7 @@ const globby = require('globby') const year = new Date().getFullYear() const yearRegex = new RegExp(`Copyright \\(c\\) ${year} GitHub Inc\\.`) +const octiconsLib = fs.readdirSync('./lib/build/svg') test(`LICENSE files have the current year ${year}`, t => { return globby(['**/LICENSE', '!**/node_modules/**/LICENSE', '!**/vendor/**/LICENSE']).then(paths => { @@ -14,3 +15,7 @@ test(`LICENSE files have the current year ${year}`, t => { }) }) }) + +test('SVG icons exist', t => { + t.not(octiconsLib.length, 0, `We didn't find any svg files`) +})