Skip to content

update action runners, dev containers #3

update action runners, dev containers

update action runners, dev containers #3

name: "Test"
on:
pull_request:
branches:
- main
jobs:
run_tests:
name: Verify PR - Tests
runs-on: home-automation
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract node version from package.json
uses: sergeysova/jq-action@v2
id: node_version
with:
cmd: jq .engines.node package.json -r | sed -e 's/"//g' | sed -e 's/>=//g'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "${{ steps.node_version.outputs.value }}"
- name: Use Yarn
run: corepack enable
- name: Install deps
run: yarn
- name: Prepare
run: yarn nx run-many --target=prepare --parallel --all
env:
ONEPASSWORD_TOKEN: ${{ secrets.ONEPASSWORD_TOKEN }}
ONEPASSWORD_SERVER_URL: ${{ secrets.ONEPASSWORD_SERVER_URL }}
ONEPASSWORD_VAULT_ID: ${{ secrets.ONEPASSWORD_VAULT_ID }}
- name: Run all tests
run: yarn run test/all
- name: Coverage
if: always()
run: yarn run test/coverage/all
env:
CODECOV_TOKEN: ${{ secrets.CODE_COV_TOKEN }}
build:
name: Verify PR - Build
runs-on: home-automation
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract node version from package.json
uses: sergeysova/jq-action@v2
id: node_version
with:
cmd: jq .engines.node package.json -r | sed -e 's/"//g' | sed -e 's/>=//g'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "${{ steps.node_version.outputs.value }}"
- name: Use Yarn
run: corepack enable
- name: Install deps
run: yarn
- name: Prepare
run: yarn nx run-many --target=prepare --parallel --all
env:
ONEPASSWORD_TOKEN: ${{ secrets.ONEPASSWORD_TOKEN }}
ONEPASSWORD_SERVER_URL: ${{ secrets.ONEPASSWORD_SERVER_URL }}
ONEPASSWORD_VAULT_ID: ${{ secrets.ONEPASSWORD_VAULT_ID }}
- name: Compile affected apps
run: yarn nx affected --target=compile --parallel --base=HEAD~ --head=HEAD --verbose --exclude=manual-deployment,pihole
env:
ONEPASSWORD_TOKEN: ${{ secrets.ONEPASSWORD_TOKEN }}
ONEPASSWORD_SERVER_URL: ${{ secrets.ONEPASSWORD_SERVER_URL }}
ONEPASSWORD_VAULT_ID: ${{ secrets.ONEPASSWORD_VAULT_ID }}
NODE_ENV: production