Skip to content

Commit

Permalink
Merge pull request #3160 from the-events-calendar/fix/gh-workflows-no…
Browse files Browse the repository at this point in the history
…de-setup

Fixes node set up for GH workflows
  • Loading branch information
dpanta94 authored Aug 7, 2024
2 parents 24da066 + 46d51b8 commit 220f5e4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 29 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: npm run lint
27 changes: 14 additions & 13 deletions .github/workflows/tests-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 20 additions & 2 deletions .github/workflows/zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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}
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}
2 changes: 1 addition & 1 deletion src/Tribe/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Tribe\Tickets\Admin\Settings;

/**
* Class Tribe__Tickets__Main
* Class Tribe__Tickets__Main.
*/
class Tribe__Tickets__Main {

Expand Down

0 comments on commit 220f5e4

Please sign in to comment.