diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 6ef1b73da..ed26ca1db 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -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 diff --git a/.github/workflows/initiate_release.yml b/.github/workflows/initiate_release.yml index 144a6fa03..5643388d8 100644 --- a/.github/workflows/initiate_release.yml +++ b/.github/workflows/initiate_release.yml @@ -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 @@ -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 }} @@ -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') diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1372cd0bc..7099251a0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/setup-node diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb4c01d7f..e1e93d0ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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') diff --git a/.github/workflows/scheduled_test.yml b/.github/workflows/scheduled_test.yml new file mode 100644 index 000000000..40304cf06 --- /dev/null +++ b/.github/workflows/scheduled_test.yml @@ -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 }} diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 52298c012..8177f6288 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -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 }}' diff --git a/.github/workflows/type.yml b/.github/workflows/type.yml index 3bc03a6bc..6ed9736ed 100644 --- a/.github/workflows/type.yml +++ b/.github/workflows/type.yml @@ -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: diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index e76f122f6..f953d56b3 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -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