This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dev dependencies and configure workflows (#116)
- Loading branch information
1 parent
0883902
commit d9c99e1
Showing
24 changed files
with
13,353 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
name: 'Development' | |||
|
|||
on: | |||
push: | |||
branches: | |||
- dev | |||
|
|||
jobs: | |||
test: | |||
name: 'Test' | |||
runs-on: ubuntu-latest | |||
steps: | |||
- name: 'Checkout dev' | |||
uses: actions/checkout@v1 | |||
- name: 'Install dependencies' | |||
run: npm ci | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Generate config.json' | |||
run: "echo \"{ \\\"development\\\": { \\\"clientId\\\": \\\"${{ secrets.TRAKT_CLIENT_ID }}\\\", \\\"clientSecret\\\": \\\"${{ secrets.TRAKT_CLIENT_SECRET }}\\\", \\\"analyticsId\\\": \\\"${{ secrets.GOOGLE_ANALYTICS_ID }}\\\", \\\"rollbarToken\\\": \\\"${{ secrets.ROLLBAR_TOKEN }}\\\", \\\"tmdbApiKey\\\": \\\"${{ secrets.TMDB_API_KEY }}\\\", \\\"chromeExtensionKey\\\": \\\"${{ secrets.CHROME_EXTENSION_KEY }}\\\", \\\"firefoxExtensionId\\\": \\\"${{ secrets.FIREFOX_EXTENSION_ID }}\\\" } }\" >> ./config.json" | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Run build' | |||
run: npm run build-dev | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Zip dist' | |||
run: npm run zip | |||
- name: 'Run tests' | |||
run: xvfb-run npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,52 @@ | |||
name: 'Production' | |||
|
|||
on: | |||
push: | |||
branches: | |||
- master | |||
|
|||
jobs: | |||
build: | |||
name: 'Build' | |||
runs-on: ubuntu-latest | |||
steps: | |||
- name: 'Checkout master' | |||
uses: actions/checkout@v1 | |||
- name: 'Install dependencies' | |||
run: npm ci | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Generate config.json' | |||
run: "echo \"{ \\\"production\\\": { \\\"clientId\\\": \\\"${{ secrets.TRAKT_CLIENT_ID }}\\\", \\\"clientSecret\\\": \\\"${{ secrets.TRAKT_CLIENT_SECRET }}\\\", \\\"analyticsId\\\": \\\"${{ secrets.GOOGLE_ANALYTICS_ID }}\\\", \\\"rollbarToken\\\": \\\"${{ secrets.ROLLBAR_TOKEN }}\\\", \\\"tmdbApiKey\\\": \\\"${{ secrets.TMDB_API_KEY }}\\\", \\\"chromeExtensionKey\\\": \\\"${{ secrets.CHROME_EXTENSION_KEY }}\\\", \\\"firefoxExtensionId\\\": \\\"${{ secrets.FIREFOX_EXTENSION_ID }}\\\" } }\" >> ./config.json" | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Run build' | |||
run: npm run build | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Zip dist' | |||
run: npm run zip | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Generate release' | |||
run: npm run generate-release token=${{ secrets.GITHUB_ACCESS_TOKEN }} | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Upload to Chrome store' | |||
uses: trmcnvn/chrome-addon@v1 | |||
with: | |||
extension: ${{ secrets.CHROME_EXTENSION_ID }} | |||
zip: ./dist/chrome.zip | |||
client-id: ${{ secrets.CHROME_CLIENT_ID }} | |||
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} | |||
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Upload to Firefox store' | |||
uses: trmcnvn/firefox-addon@v1 | |||
with: | |||
uuid: ${{ secrets.FIREFOX_EXTENSION_ID }} | |||
xpi: ./dist/firefox.zip | |||
manifest: ./browser/build/firefox/manifest.json | |||
api-key: ${{ secrets.FIREFOX_CLIENT_ID }} | |||
api-secret: ${{ secrets.FIREFOX_CLIENT_SECRET }} | |||
- if: github.repository == 'rafaelgssa/traktflix' | |||
name: 'Run tests and send coverage' | |||
run: xvfb-run npm test token=${{ secrets.COVERALLS_TOKEN }} | |||
- if: github.repository != 'rafaelgssa/traktflix' | |||
name: 'Run tests' | |||
run: xvfb-run npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,20 +1,6 @@ | |||
node_modules | node_modules/ | ||
temp | build/ | ||
.tmp | coverage/ | ||
dist | dist/ | ||
.sass-cache | |||
app/bower_components | |||
test/bower_components | |||
package | |||
build | |||
*.log | |||
.DS_Store | |||
*.crx | |||
*.pem | |||
coverage | |||
config.json | config.json | ||
bext.json | *.log | ||
.idea/ | |||
extension-*.zip | |||
src.zip | |||
package-lock.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
0
traktflix.png → assets/traktflix.png
100755 → 100644
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,31 +1,19 @@ | |||
const fs = require(`fs`); | |||
const gulp = require(`gulp`); | |||
const zip = require(`gulp-zip`); | |||
const generateManifest = require(`./scripts/generateManifest.js`); | |||
|
|
||
gulp.task(`zip-chrome`, () => { | const gulp = require('gulp'); | ||
return zipExtension(`chrome`); | const zip = require('gulp-zip'); | ||
}); | |||
|
|||
gulp.task(`zip-firefox`, () => { | |||
return zipExtension(`firefox`); | |||
}); | |||
|
|
||
function zipExtension(browserName) { | function zipExtension(browserName) { | ||
fs.writeFileSync(`./build/manifest.json`, generateManifest(browserName)); | return gulp.src([`build/${browserName}/**`]) | ||
|
.pipe(zip(`${browserName}.zip`)) | ||
return gulp.src([ | .pipe(gulp.dest('./dist')); | ||
`build/**` | |||
]) | |||
.pipe(zip(`extension-${browserName}.zip`)) | |||
.pipe(gulp.dest(`./`)); | |||
} | } | ||
|
|
||
gulp.task(`zip-src`, () => { | gulp.task('zip-chrome', () => { | ||
return gulp.src([ | return zipExtension('chrome'); | ||
`README.md`, | }); | ||
`src/**` |
|
||
]) | gulp.task('zip-firefox', () => { | ||
.pipe(zip(`src.zip`)) | return zipExtension('firefox'); | ||
.pipe(gulp.dest(`./`)); | }); | ||
}); |
|
||
gulp.task('zip', gulp.parallel('zip-chrome', 'zip-firefox')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,32 +1,44 @@ | |||
const { getArguments } = require('./scripts/common'); | |||
|
|||
const args = getArguments(process); | |||
|
|||
module.exports = config => { | module.exports = config => { | ||
let webpackConfig = require(`./webpack.config.js`); | const webpackConfig = require('./webpack.config.js'); | ||
webpackConfig = webpackConfig({ development: true, test: true }); |
|
||
const configuration = { | const karmaConfig = { | ||
autoWatch: false, | autoWatch: false, | ||
basePath: '', | basePath: '', | ||
browsers: [`Chrome`, `Firefox`], | browsers: ['Chrome', 'Firefox'], | ||
client: { | client: { | ||
jasmine: { | jasmine: { | ||
random: false | random: false | ||
} | } | ||
}, | }, | ||
concurrency: 1, | concurrency: 1, | ||
files: [ | files: [ | ||
`test/**/*.js` | 'test/**/*.js' | ||
], | ], | ||
frameworks: [`mocha`, `chai`], | frameworks: ['mocha', 'chai'], | ||
preprocessors: { | preprocessors: { | ||
[`test/**/*.js`]: [`webpack`] | ['test/**/*.js']: ['webpack'] | ||
}, | }, | ||
singleRun: true, | singleRun: true, | ||
webpack: webpackConfig | webpack: webpackConfig({ | ||
development: true, | |||
test: true | |||
}) | |||
}; | }; | ||
if (process.env.TRAVIS) { |
|
||
configuration.reporters = [`progress`, `coverage`]; | if (args.token) { | ||
configuration.coverageReporter = { | karmaConfig.coverallsReporter = { | ||
dir: `coverage/`, | repoToken: args.token | ||
type: `lcov` | |||
}; | }; | ||
karmaConfig.coverageReporter = { | |||
dir: 'coverage/', | |||
type: 'lcov' | |||
}; | |||
karmaConfig.reporters = ['progress', 'coverage', 'coveralls']; | |||
} | } | ||
config.set(configuration); |
|
||
config.set(karmaConfig); | |||
}; | }; |
Oops, something went wrong.