mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-11-28 08:08:03 -08:00
* style: format build-args test with oxfmt * ci: check formatting in the integrity job yarn format:check was only run locally, so unformatted code could land on main unnoticed.
57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
name: Integrity
|
|
|
|
on:
|
|
push: { branches: [main] }
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, labeled]
|
|
|
|
permissions:
|
|
contents: read
|
|
checks: write
|
|
statuses: write
|
|
|
|
env:
|
|
CODECOV_TOKEN: '2f2eb890-30e2-4724-83eb-7633832cf0de'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install package manager (from package.json)
|
|
run: |
|
|
corepack enable
|
|
corepack install
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
- name: Resolve yarn cache folder
|
|
id: yarn-config
|
|
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
.yarn/install-state.gz
|
|
key: yarn-v2-${{ runner.os }}-node-18-${{ hashFiles('yarn.lock') }}
|
|
restore-keys: |
|
|
yarn-v2-${{ runner.os }}-node-18-
|
|
- name: Install deps
|
|
env:
|
|
YARN_ENABLE_HARDENED_MODE: 'false'
|
|
run: |
|
|
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
|
|
yarn install --immutable
|
|
- run: yarn lint
|
|
- run: yarn format:check
|
|
- run: yarn test:ci --coverage
|
|
- run: bash <(curl -s https://codecov.io/bash)
|
|
- run: yarn build || { echo "build command should always succeed" ; exit 61; }
|
|
# - run: yarn build --quiet && git diff --quiet dist || { echo "dist should be auto generated" ; git diff dist ; exit 62; }
|