Skip to content

Commit

Permalink
Merge pull request #671 from SUI-Components/chore/update-github-workflow
Browse files Browse the repository at this point in the history
chore(Root): Update Github Workflow
  • Loading branch information
Pato2790 authored Oct 10, 2024
2 parents e177e93 + 6d9eb84 commit 05c5600
Show file tree
Hide file tree
Showing 12 changed files with 52,439 additions and 1,018 deletions.
136 changes: 69 additions & 67 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,91 +10,93 @@ jobs:
check-skip:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Redundant Builds
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- name: Cancel Previous Redundant Builds
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}

build:
needs: check-skip
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
npm install --legacy-peer-deps --no-audit --no-fund --no-optional && npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
npm run lint
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: public-folder
path: public
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
npm ci --legacy-peer-deps --no-audit --no-fund --no-optional && npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
npm run lint
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: public-folder
path: public

testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Install xvfb for headless testing
run: sudo apt-get install xvfb
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install xvfb for headless testing
run: sudo apt-get install xvfb

- name: Setup Max User Watches for Testing
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Setup Max User Watches for Testing
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- name: Testing
run: |
npm install --legacy-peer-deps --no-audit --no-fund --no-optional
npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
xvfb-run --auto-servernum npm run test -- --ci
- name: Testing
run: |
npm ci --legacy-peer-deps --no-audit --no-fund --no-optional
npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
xvfb-run --auto-servernum npm run test -- --ci
release:
needs: [build, testing]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Release components
run: |
npm install --legacy-peer-deps --no-audit --no-fund --no-optional
npx @s-ui/ci release
env:
GITHUB_EMAIL: cloud-accounts@scmspain.com
GITHUB_TOKEN: ${{github.token}}
GITHUB_USER: sui-bot
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Release components
run: |
npm ci --legacy-peer-deps --no-audit --no-fund --no-optional
npx @s-ui/ci release
env:
GITHUB_EMAIL: cloud-accounts@scmspain.com
GITHUB_TOKEN: ${{github.token}}
GITHUB_USER: sui-bot
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

deploy:
needs: [build, testing]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/download-artifact@v2
with:
name: public-folder
- name: Deploy
run: |
npm i -g vercel --no-save --no-fund --no-audit --no-optional --no-scripts
DEPLOYMENT_URL=$(vercel --token $VERCEL_TOKEN --confirm $VERCEL_PARAMS)
env:
VERCEL_PARAMS: ${{ github.event_name != 'pull_request' && '--prod' || ''}}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v3
with:
name: public-folder
- name: Deploy
run: |
npm i -g vercel --no-save --no-fund --no-audit --no-optional --no-scripts
DEPLOYMENT_URL=$(vercel --token $VERCEL_TOKEN --confirm $VERCEL_PARAMS)
env:
VERCEL_PARAMS: ${{ github.event_name != 'pull_request' && '--prod' || ''}}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ public/
lib/
npm-debug.log
lib
package-lock.json
.env
.DS_Store
components/package.json
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20.15.1
Loading

0 comments on commit 05c5600

Please sign in to comment.