Skip to content

Remove IE support warning code in index.htmls #402

Remove IE support warning code in index.htmls

Remove IE support warning code in index.htmls #402

Workflow file for this run

name: Test and Deploy
on:
push:
branches: [ '**' ]
tags: [ '*' ]
pull_request:
branches: [ 'master' ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
unit_test_backend:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop
- name: Set up MariaDB
uses: getong/mariadb-action@v1.1
with:
mysql database: compair
mysql root password: ''
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get update
sudo apt-get install -y --no-install-recommends --no-install-suggests libxmlsec1-dev libz-dev
pip install setuptools==57.5.0
pip install -r requirements.txt -r requirements.dev.txt
- name: Backend Unit Tests MariaDB
run: |
DATABASE_URI="mysql+pymysql://root@localhost/compair" pytest
- name: Backend Unit Tests SQLite
run: |
DATABASE_URI="sqlite:///:memory:" pytest
unit_test_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: |
npm install
node_modules/gulp/bin/gulp.js
- name: Frontend Karma Tests
run: |
node_modules/karma/bin/karma start compair/static/test/config/karma.conf.js --single-run
deploy_assets:
runs-on: ubuntu-latest
needs: [ unit_test_backend, unit_test_frontend ]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: |
npm install
node_modules/gulp/bin/gulp.js
- name: Generate assets
run: |
node_modules/webpack/bin/webpack.js --mode production
node_modules/gulp/bin/gulp.js prod
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Upload to S3
run: aws s3 cp compair/static/dist s3://compair-assets/dist --recursive
deploy_docker_image:
runs-on: ubuntu-latest
needs: [ unit_test_backend, unit_test_frontend ]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ubcctlt/compair-app
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# TODO: add acceptance testing (would be easier with a slight rewrite to gulp/generate_index)