Skip to content

Commit

Permalink
build: added workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobruni committed Mar 9, 2023
1 parent 8deb994 commit d8a24ed
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: matteobruni,tsparticles
142 changes: 142 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Node.js CI
on:
push:
branches:
- main
- legacy
pull_request:
branches:
- main
- legacy

#env:
#NX_CLOUD_DISTRIBUTED_EXECUTION: true
#NX_CLOUD_ACCESS_TOKEN: '${{ secrets.NX_CLOUD_ACCESS_TOKEN }}'
#NX_BRANCH: '${{github.event.pull_request.number || github.ref_name}}'

jobs:

main:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v3
name: Checkout [main]
with:
fetch-depth: 0
#- name: Derive appropriate SHAs for base and head for `nx affected` commands
# uses: nrwl/nx-set-shas@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm version
id: pnpm-version
run: |
echo "$(pnpm --version)"
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install --no-frozen-lockfile
#- run: npx nx-cloud start-ci-run
#- run: pnpm run prettify:ci:readme
- run: npx lerna run build:ci #--concurrency 3
#- run: npx nx-cloud stop-all-agents
pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
#- name: Derive appropriate SHAs for base and head for `nx affected` commands
# uses: nrwl/nx-set-shas@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm version
id: pnpm-version
run: |
echo "$(pnpm --version)"
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install --no-frozen-lockfile
#- run: npx nx-cloud start-ci-run
#- run: pnpm run prettify:ci:readme
- run: npx lerna run build:ci #--concurrency 3
#- run: npx nx-cloud stop-all-agents
- run: echo ${{ github.repository_owner }}
- run: echo ${{ github.actor }}

# agents:
# runs-on: ubuntu-latest
# name: Nx Agent
# timeout-minutes: 60
# strategy:
# matrix:
# agent: [ 1, 2, 3 ]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '16'
# - uses: pnpm/[email protected]
# name: Install pnpm
# id: pnpm-install
# with:
# version: 7
# run_install: false
# - name: Get pnpm version
# id: pnpm-version
# run: |
# echo "$(pnpm --version)"
#
# - name: Get pnpm store directory
# id: pnpm-cache
# run: |
# echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
#
# - uses: actions/cache@v3
# name: Setup pnpm cache
# with:
# path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-
# - run: pnpm install --no-frozen-lockfile
# - name: Start Nx Agent ${{ matrix.agent }}
# run: npx nx-cloud start-agent

0 comments on commit d8a24ed

Please sign in to comment.