Skip to content

Commit

Permalink
fix(actions): testing composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelramos committed Jan 21, 2024
1 parent 6dcd954 commit d64552d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 49 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/workflow-checkout.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: '[Workflow] Checkout'
author: miguelramos
branding:
color: 'purple'
icon: 'octagon'

on:
workflow_call:
inputs:
depth:
description: 'Depth'
default: 0
type: number
inputs:
depth:
description: 'Depth'
default: 0
type: number

jobs:
checkout-repo:
name: Checkout Repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event.inputs.depth }}
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event.inputs.depth }}
30 changes: 15 additions & 15 deletions .github/workflows/workflow-node.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: '[Workflow] NodeJs'
author: miguelramos
branding:
color: 'green'
icon: 'moon'

on:
workflow_call:
inputs:
version:
description: 'Node version'
default: '20'
type: string
inputs:
version:
description: 'Node version'
default: '20'
type: string

jobs:
install-node:
name: Install Node
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ github.event.inputs.version }}
runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ github.event.inputs.version }}
48 changes: 29 additions & 19 deletions .github/workflows/workflow-pnpm.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
name: '[Workflow] Pnpm'
author: miguelramos
branding:
color: 'orange'
icon: 'package'

on:
workflow_call:
secrets:
NPM_TOKEN:
required: true
inputs:
secrets:
NPM_TOKEN:
required: true

env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
runs:
using: "composite"
env:
CI: true
PNPM_CACHE_FOLDER: ~/.pnpm-store
steps:
- name: Restore cache for pnpm and node_modules
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
jobs:
install-pnpm:
name: Install pnpm
runs-on: ubuntu-latest
steps:
- name: Install pnpm package manager
run: npm i pnpm@latest -g
- name: Install pnpm package manager
run: npm i pnpm@latest -g

- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

- name: Setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: Setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

0 comments on commit d64552d

Please sign in to comment.