Move translations tests to cron (#32097)

Co-authored-by: Peter Bengtsson <peterbe@github.com>
This commit is contained in:
Kevin Heis 2022-10-31 12:17:36 -07:00 коммит произвёл GitHub
Родитель 4ae8ea563c
Коммит 00814c80b0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 64 добавлений и 12 удалений

63
.github/workflows/test-translations.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,63 @@
name: Translations tests
# **What it does**: Runs our translation tests on cron.
# **Why we have it**: We want to know if translations act up, but they are in separate repositories.
# **Who does it impact**: Docs engineering.
on:
workflow_dispatch:
schedule:
- cron: '35 16 * * *' # Run once per day at 16:35 UTC / 9:35 PST
permissions:
contents: read
pull-requests: read
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
test:
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-20.04-xl
timeout-minutes: 60
steps:
- name: Check out repo
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup node
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048
with:
node-version: '16.17.0'
cache: npm
- name: Install dependencies
run: npm ci
- name: Cache nextjs build
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}
- name: Run build script
run: npm run build
- name: Run tests
run: npm test -- tests/translations
send-slack-notification-on-failure:
needs: [test]
runs-on: ubuntu-20.04-xl
if: ${{ failure() }}
steps:
- name: Send Slack notification if workflow failed
uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
if: ${{ failure() }}
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: Translations test failure. See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

13
.github/workflows/test.yml поставляемый
Просмотреть файл

@ -11,7 +11,6 @@ on:
permissions:
contents: read
# Needed for the 'trilom/file-changes-action' action
pull-requests: read
# This allows a subsequently queued workflow run to interrupt previous runs
@ -37,17 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-group:
[
content,
graphql,
meta,
rendering,
routing,
unit,
linting,
translations,
]
test-group: [content, graphql, meta, rendering, routing, unit, linting]
steps:
- name: Install a local Elasticsearch for testing
# For the sake of saving time, only run this step if the test-group