diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..573b00f --- /dev/null +++ b/.github/workflows/build-test.yml @@ -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 }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b930cd8 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bf63cc1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -sudo: false -dist: trusty -language: node_js -node_js: -- '14' -env: - matrix: - - SAUCE=true -addons: - chrome: stable - firefox: latest - apt: - packages: - - python3-pip -script: -- npm test -- npm run browser-test -- npm run lint -after_sucess: -- cat coverage/lcov.info | ./node_modules/.bin/coveralls -git: - depth: 1 - submodules: false -cache: - directories: - - node_modules -before_deploy: -- npm run build-stage -deploy: - skip_cleanup: true - provider: script - script: ci/travis_deploy.sh - on: - branch: master diff --git a/README.md b/README.md index 66958f6..112be5c 100644 --- a/README.md +++ b/README.md @@ -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] @@ -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 diff --git a/ci/requirements.txt b/ci/requirements.txt new file mode 100644 index 0000000..7326a10 --- /dev/null +++ b/ci/requirements.txt @@ -0,0 +1 @@ +boto3==1.20.52 diff --git a/karma.conf.js b/karma.conf.js index d32177f..d8a2ee7 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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",