Skip to content

Commit

Permalink
Migrate from travis to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bacher09 committed Feb 10, 2022
1 parent e745165 commit 8fc8acf
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 47 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tests

on:
push:
branches: [main]
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'


jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
cache: npm
- name: Node checks
run: |
npm ci
npm test
npm run lint
- name: Install browsers
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
run: |
sudo apt-get update -q -y
sudo apt-get install -q -y chromium-chromedriver firefoxdriver
- name: Run browser tests
run: npm run browser-test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy

on:
workflow_dispatch:
workflow_run:
workflows: ["Tests"]
branches: [main]
types: [completed]


jobs:
staging-deploy:
name: Deploy to beta.bios-pw.org
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event.workflow_dispatch.sender.site_admin == true }}
runs-on: ubuntu-latest
concurrency: beta
environment:
name: beta
url: https://beta.bios-pw.org/

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install python
uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: ./ci/requirements.txt

- name: Install boto3
run: pip install -r ./ci/requirements.txt

- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
cache: npm

- name: Build scripts and assets
run: npm run build-stage

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@13d241b293754004c80624b5567555c4a39ffbe3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Upload assets to S3
run: ./ci/deploy.py ./dist/ beta.bios-pw.org
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Password generator for BIOS
================================
[![travis status][build-status]][travis]
[![github actions status][build-status]][tests]
[![coverage here][coverage-status]][coverage]

[![tested-browsers][sauce-matrix]][sauce-link]
Expand Down Expand Up @@ -36,8 +36,8 @@ Latest released version available [here][bios-pw] and latest testing version (*s
* hpgl — for dell generator
* [let-def](https://github.com/let-def) — for Acer Insyde 10 digit

[build-status]: https://api.travis-ci.org/bacher09/pwgen-for-bios.svg?branch=master
[travis]: https://travis-ci.org/bacher09/pwgen-for-bios
[build-status]: https://github.com/bacher09/pwgen-for-bios/actions/workflows/build-test.yml/badge.svg
[tests]: https://github.com/bacher09/pwgen-for-bios/actions/workflows/build-test.yml
[coverage-status]: https://coveralls.io/repos/github/bacher09/pwgen-for-bios/badge.svg?branch=master
[coverage]: https://coveralls.io/github/bacher09/pwgen-for-bios?branch=master
[sauce-matrix]: https://saucelabs.com/browser-matrix/bacher09.svg
Expand Down
1 change: 1 addition & 0 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
boto3==1.20.52
12 changes: 2 additions & 10 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@ const path = require("path");
module.exports = function(config) {

var customLaunchers = {
sl_ios_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'iOS',
deviceName: 'iPhone 7 Simulator',
version: '10.3',
deviceOrientation: 'portrait'
},
sl_safari_7: {
base: "SauceLabs",
browserName: "safari",
platform: "OS X 10.11",
version: "10.0"
platform: "OS X 10.12",
version: "11.0"
},
sl_edge_13: {
base: "SauceLabs",
Expand Down

0 comments on commit 8fc8acf

Please sign in to comment.