Skip to content

Commit

Permalink
chore: add scheduled tests (#962)
Browse files Browse the repository at this point in the history
Co-authored-by: ferhat elmas <elmas.ferhat@gmail.com>
  • Loading branch information
peterdeme and ferhatelmas committed Apr 28, 2022
1 parent 0fe4e45 commit a9a9bfd
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ runs:
with:
node-version: ${{ inputs.node-version }}
registry-url: https://registry.npmjs.org

- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ inputs.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ inputs.node-version }}-modules-

- name: Install Dependencies & Build
run: yarn install --frozen-lockfile --ignore-engines
shell: bash
6 changes: 3 additions & 3 deletions .github/workflows/initiate_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: 🚀 Create release PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # gives the changelog generator access to all previous commits

Expand All @@ -21,7 +21,7 @@ jobs:
uses: WyriHaximus/github-action-get-previous-tag@v1

- name: Ensure version number higher than current
uses: actions/github-script@v5
uses: actions/github-script@v6
env:
PREVIOUS_TAG: ${{ steps.previoustag.outputs.tag }}
DESTINATION_TAG: ${{ github.event.inputs.version }}
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
git push -q -u origin "release-$VERSION"
- name: Get changelog diff
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
const get_change_log_diff = require('./scripts/get_changelog_diff.js')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: ./.github/actions/setup-node

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
if: github.event.pull_request.merged && startsWith(github.head_ref, 'release-')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
const get_change_log_diff = require('./scripts/get_changelog_diff.js')
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/scheduled_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Scheduled tests

on:
workflow_dispatch:
schedule:
# Monday at 9:00 UTC
- cron: "0 9 * * 1"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup-node

- name: Run test
env:
API_KEY: ${{ secrets.TS_TEST_API_KEY }}
API_SECRET: ${{ secrets.TS_TEST_API_SECRET }}
MULTITENANCY_API_KEY: ${{ secrets.TS_TEST_MULTITENANCY_API_KEY }}
MULTITENANCY_API_SECRET: ${{ secrets.TS_TEST_MULTITENANCY_API_SECRET }}
run: |
# Retry 3 times because tests can be flaky
for _ in 1 2 3;
do
yarn test-types && break
done
- name: Notify Slack if failed
uses: voxmedia/github-action-slack-notify-build@v1
if: failure()
with:
channel_id: C02RPDF7T63
color: danger
status: FAILED
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
4 changes: 3 additions & 1 deletion .github/workflows/type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: ./.github/actions/setup-node

- name: Run API type definition tests
run: yarn test-types
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ jobs:
matrix:
node: [12, 14, 16, 17]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: ./.github/actions/setup-node
with:
node-version: ${{ matrix.node }}

- name: Unit tests
run: yarn run test-coverage

0 comments on commit a9a9bfd

Please sign in to comment.