diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 686ffa0496..83d3f42aec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,19 +15,20 @@ jobs: with: fetch-depth: 1 submodules: recursive - - name: Set node version - run: | - . ~/.nvm/nvm.sh && nvm install $(cat .nvmrc) && nvm use - - name: Get npm cache - uses: actions/cache@v2 - id: npm-cache + # ------------------------------------------------------------------------------ + # Setup Node. + # ------------------------------------------------------------------------------ + - name: Check for .nvmrc file + id: check-nvmrc + run: echo "::set-output name=exists::$(test -f ${{ github.workspace }}/.nvmrc && echo 'true' || echo 'false')" + + - uses: actions/setup-node@v3 + if: steps.check-nvmrc.outputs.exists == 'true' with: - path: '~/.npm' - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-npm- + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: package-lock.json - name: Install node modules - run: | - . ~/.nvm/nvm.sh && nvm use && npm ci + run: npm ci - name: Run linting tasks - run: | - . ~/.nvm/nvm.sh && nvm use && npm run lint \ No newline at end of file + run: npm run lint diff --git a/.github/workflows/tests-js.yml b/.github/workflows/tests-js.yml index ab96903e6b..43cb9014d0 100644 --- a/.github/workflows/tests-js.yml +++ b/.github/workflows/tests-js.yml @@ -13,19 +13,20 @@ jobs: with: fetch-depth: 1 submodules: recursive - - name: Set node version - run: | - . ~/.nvm/nvm.sh && nvm install $(cat .nvmrc) && nvm use - - name: Get npm cache - uses: actions/cache@v2 - id: npm-cache + # ------------------------------------------------------------------------------ + # Setup Node. + # ------------------------------------------------------------------------------ + - name: Check for .nvmrc file + id: check-nvmrc + run: echo "::set-output name=exists::$(test -f ${{ github.workspace }}/.nvmrc && echo 'true' || echo 'false')" + + - uses: actions/setup-node@v3 + if: steps.check-nvmrc.outputs.exists == 'true' with: - path: '~/.npm' - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-npm- + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: package-lock.json - name: Install node modules - run: | - . ~/.nvm/nvm.sh && nvm use && npm ci + run: npm ci - name: Run jest task - run: | - . ~/.nvm/nvm.sh && nvm use && npm run jest + run: npm run jest diff --git a/.github/workflows/zip.yml b/.github/workflows/zip.yml index 978b7cd105..7e2f61f586 100644 --- a/.github/workflows/zip.yml +++ b/.github/workflows/zip.yml @@ -42,7 +42,7 @@ jobs: name: id_rsa known_hosts: github.com # ------------------------------------------------------------------------------ - # Checkout the repo and tut + # Checkout the repo # ------------------------------------------------------------------------------ - name: Checkout the repository uses: actions/checkout@v2 @@ -51,6 +51,24 @@ jobs: token: ${{ secrets.GH_BOT_TOKEN }} submodules: recursive ref: ${{ steps.settings.outputs.branch }} + + # ------------------------------------------------------------------------------ + # Setup Node. + # ------------------------------------------------------------------------------ + - name: Check for .nvmrc file + id: check-nvmrc + run: echo "::set-output name=exists::$(test -f ${{ github.workspace }}/.nvmrc && echo 'true' || echo 'false')" + + - uses: actions/setup-node@v3 + if: steps.check-nvmrc.outputs.exists == 'true' + with: + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: package-lock.json + + # ------------------------------------------------------------------------------ + # Checkout tut + # ------------------------------------------------------------------------------ - name: Checkout tut uses: actions/checkout@v2 with: @@ -196,4 +214,4 @@ jobs: if: github.event_name == 'workflow_dispatch' && github.event.inputs.slack_channel != '' && github.event.inputs.slack_thread != '' working-directory: ../ run: | - php ${GITHUB_WORKSPACE}/jenkins-scripts/mt-jenkins package:send-results --channel ${{ github.event.inputs.slack_channel }} --ts ${{ github.event.inputs.slack_thread }} --results-file "${GITHUB_WORKSPACE}/results.txt" --slack-token ${{ secrets.SLACK_TOKEN }} --build-url https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} \ No newline at end of file + php ${GITHUB_WORKSPACE}/jenkins-scripts/mt-jenkins package:send-results --channel ${{ github.event.inputs.slack_channel }} --ts ${{ github.event.inputs.slack_thread }} --results-file "${GITHUB_WORKSPACE}/results.txt" --slack-token ${{ secrets.SLACK_TOKEN }} --build-url https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index ce8a8b6699..e114a948bb 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -8,7 +8,7 @@ use Tribe\Tickets\Admin\Settings; /** - * Class Tribe__Tickets__Main + * Class Tribe__Tickets__Main. */ class Tribe__Tickets__Main {