Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add scheduled tests #962

Merged
merged 2 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems this is breaking

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this custom btw?

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 }}
ferhatelmas marked this conversation as resolved.
Show resolved Hide resolved
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