ha-frontend/.github/workflows/ci.yaml

99 lines
2.8 KiB
YAML
Raw Normal View History

2020-02-21 13:59:09 +01:00
name: CI
on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master
2020-02-21 13:59:09 +01:00
2021-07-07 16:33:24 +02:00
env:
2022-07-19 11:39:08 +02:00
NODE_VERSION: 16
NODE_OPTIONS: --max_old_space_size=6144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2021-07-07 16:33:24 +02:00
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
2020-02-21 13:59:09 +01:00
jobs:
lint:
name: Lint and check format
2020-02-21 13:59:09 +01:00
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@v3.3.0
2021-07-07 16:33:24 +02:00
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3.6.0
2020-02-21 13:59:09 +01:00
with:
2021-07-07 16:33:24 +02:00
node-version: ${{ env.NODE_VERSION }}
cache: yarn
2020-02-21 13:59:09 +01:00
- name: Install dependencies
run: yarn install --immutable
- name: Check for duplicate dependencies
run: yarn dedupe --check
2020-06-22 19:24:01 +02:00
- name: Build resources
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
2020-02-21 13:59:09 +01:00
- name: Run eslint
run: yarn run lint:eslint --quiet
2020-02-21 13:59:09 +01:00
- name: Run tsc
2021-04-30 21:15:31 +02:00
run: yarn run lint:types
- name: Run prettier
run: yarn run lint:prettier
2020-02-21 13:59:09 +01:00
test:
name: Run tests
2020-02-21 13:59:09 +01:00
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@v3.3.0
2021-07-07 16:33:24 +02:00
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3.6.0
2020-02-21 13:59:09 +01:00
with:
2021-07-07 16:33:24 +02:00
node-version: ${{ env.NODE_VERSION }}
cache: yarn
2020-02-21 13:59:09 +01:00
- name: Install dependencies
run: yarn install --immutable
- name: Build resources
run: ./node_modules/.bin/gulp build-translations build-locale-data
- name: Run Tests
run: yarn run test
2020-02-21 13:59:09 +01:00
build:
name: Build frontend
2020-02-21 13:59:09 +01:00
needs: [lint, test]
runs-on: ubuntu-latest
2020-02-21 13:59:09 +01:00
steps:
- name: Check out files from GitHub
uses: actions/checkout@v3.3.0
2021-07-07 16:33:24 +02:00
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3.6.0
2020-02-21 13:59:09 +01:00
with:
2021-07-07 16:33:24 +02:00
node-version: ${{ env.NODE_VERSION }}
cache: yarn
2020-02-21 13:59:09 +01:00
- name: Install dependencies
run: yarn install --immutable
2020-02-21 13:59:09 +01:00
- name: Build Application
run: ./node_modules/.bin/gulp build-app
env:
IS_TEST: "true"
2020-02-21 13:59:09 +01:00
supervisor:
name: Build supervisor
2020-02-21 13:59:09 +01:00
needs: [lint, test]
runs-on: ubuntu-latest
2020-02-21 13:59:09 +01:00
steps:
- name: Check out files from GitHub
uses: actions/checkout@v3.3.0
2021-07-07 16:33:24 +02:00
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3.6.0
2020-02-21 13:59:09 +01:00
with:
2021-07-07 16:33:24 +02:00
node-version: ${{ env.NODE_VERSION }}
cache: yarn
2020-02-21 13:59:09 +01:00
- name: Install dependencies
run: yarn install --immutable
2020-02-21 13:59:09 +01:00
- name: Build Application
run: ./node_modules/.bin/gulp build-hassio
env:
IS_TEST: "true"