mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Split out unit tests from CI matrix
refs https://github.com/TryGhost/Toolbox/issues/208 - unit tests (shouldn't) be database dependent so they don't need to be included in the DB matrix - this prevents an extra 6 executions of unit tests, which isn't a big deal given they only take 10s to run, but semantically they belong outside so this commit does that - also updates the canary step to rely on this extra test run
This commit is contained in:
parent
6537ed1485
commit
d4759d30a7
1 changed files with 32 additions and 6 deletions
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
|
@ -93,7 +93,37 @@ jobs:
|
||||||
- run: yarn knex-migrator rollback --v 4.0 --force
|
- run: yarn knex-migrator rollback --v 4.0 --force
|
||||||
- run: yarn knex-migrator migrate --force
|
- run: yarn knex-migrator migrate --force
|
||||||
|
|
||||||
test:
|
unit-tests:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node: [ '12.22.1', '14.17.0', '16.13.0' ]
|
||||||
|
name: Unit Tests (Node ${{ matrix.node }})
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 0
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
cache: yarn
|
||||||
|
|
||||||
|
- run: yarn
|
||||||
|
- run: yarn test:unit
|
||||||
|
|
||||||
|
- name: Unit test coverage
|
||||||
|
run: yarn cov:unit
|
||||||
|
- uses: codecov/codecov-action@v2
|
||||||
|
|
||||||
|
- uses: daniellockyer/action-slack-build@master
|
||||||
|
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
with:
|
||||||
|
status: ${{ job.status }}
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
|
||||||
|
database-tests:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -193,10 +223,6 @@ jobs:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Unit test coverage
|
|
||||||
run: yarn cov:unit
|
|
||||||
- uses: codecov/codecov-action@v2
|
|
||||||
|
|
||||||
- uses: daniellockyer/action-slack-build@master
|
- uses: daniellockyer/action-slack-build@master
|
||||||
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
with:
|
with:
|
||||||
|
@ -267,7 +293,7 @@ jobs:
|
||||||
|
|
||||||
canary:
|
canary:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
needs: [lint, migrations, test, ghost-cli]
|
needs: [lint, migrations, unit-tests, database-tests, ghost-cli]
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
name: Canary
|
name: Canary
|
||||||
steps:
|
steps:
|
||||||
|
|
Loading…
Add table
Reference in a new issue