Skip to content

Commit

Permalink
ci: action 变动 (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela authored Dec 22, 2023
1 parent 557e024 commit ec46eff
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 126 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/auto_assign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,10 @@ jobs:
node-version: lts/*
check-latest: true
cache: npm
- name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash
id: version
shell: bash
run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Try to restore node_modules from cache
id: cache
- name: Installing the dependencies
uses: AnnAngela/cached_node-modules@v1
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
- name: Install dependencies if no cache for node_modules
run: npm run ci
if: success() && steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache/save@v3
if: success() && steps.cache.outputs.cache-hit != 'true'
name: Save node_modules to cache
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
command: npm run ci
- name: add assignees and reviewers
run: |
node scripts/autoAssign/index.js
21 changes: 3 additions & 18 deletions .github/workflows/detectHardcodedOutdatedNPMPackages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,9 @@ jobs:
node-version: lts/*
check-latest: true
cache: npm
- name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash
id: version
shell: bash
run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Try to restore node_modules from cache
id: cache
- name: Installing the dependencies
uses: AnnAngela/cached_node-modules@v1
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
- name: Install dependencies if no cache for node_modules
run: npm run ci
if: success() && steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache/save@v3
if: success() && steps.cache.outputs.cache-hit != 'true'
name: Save node_modules to cache
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
command: npm run ci
- name: Detect hardcoded-outdated NPM packages
run: node scripts/detectHardcodedOutdatedNPMPackages/index.js
21 changes: 3 additions & 18 deletions .github/workflows/generateConfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,10 @@ jobs:
node-version: lts/*
check-latest: true
cache: npm
- name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash
id: version
shell: bash
run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Try to restore node_modules from cache
id: cache
- name: Installing the dependencies
uses: AnnAngela/cached_node-modules@v1
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
- name: Install dependencies if no cache for node_modules
run: npm run ci
if: success() && steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache/save@v3
if: success() && steps.cache.outputs.cache-hit != 'true'
name: Save node_modules to cache
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
command: npm run ci
- name: Prepare git
run: node scripts/postCommit/prepareGit.js
- name: Expose GitHub Runtime
Expand Down
84 changes: 12 additions & 72 deletions .github/workflows/postCommit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,10 @@ jobs:
node-version: lts/*
check-latest: true
cache: npm
- name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash
id: version
shell: bash
run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Try to restore node_modules from cache
id: cache
- name: Installing the dependencies
uses: AnnAngela/cached_node-modules@v1
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
- name: Install dependencies if no cache for node_modules
run: npm run ci
if: success() && steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache/save@v3
if: success() && steps.cache.outputs.cache-hit != 'true'
name: Save node_modules to cache
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
command: npm run ci
- name: If needs to skip, skip now
run: node scripts/skip/index.js
id: skip
Expand All @@ -116,25 +101,10 @@ jobs:
node-version: lts/*
check-latest: true
cache: npm
- name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash
id: version
shell: bash
run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Try to restore node_modules from cache
id: cache
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
- name: Install dependencies if no cache for node_modules
run: npm run ci
if: success() && steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache/save@v3
if: success() && steps.cache.outputs.cache-hit != 'true'
name: Save node_modules to cache
- name: Installing the dependencies
uses: AnnAngela/cached_node-modules@v1
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
command: npm run ci
- name: Git config
run: node scripts/postCommit/prepareGit.js
- name: Expose GitHub Runtime
Expand Down Expand Up @@ -177,25 +147,10 @@ jobs:
node-version: lts/*
check-latest: true
cache: npm
- name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash
id: version
shell: bash
run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Try to restore node_modules from cache
id: cache
- name: Installing the dependencies
uses: AnnAngela/cached_node-modules@v1
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
- name: Install dependencies if no cache for node_modules
run: npm run ci
if: success() && steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache/save@v3
if: success() && steps.cache.outputs.cache-hit != 'true'
name: Save node_modules to cache
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
command: npm run ci
- name: Reload the linter cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -229,25 +184,10 @@ jobs:
node-version: lts/*
check-latest: true
cache: npm
- name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash
id: version
shell: bash
run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Try to restore node_modules from cache
id: cache
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
- name: Install dependencies if no cache for node_modules
run: npm run ci
if: success() && steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache/save@v3
if: success() && steps.cache.outputs.cache-hit != 'true'
name: Save node_modules to cache
- name: Installing the dependencies
uses: AnnAngela/cached_node-modules@v1
with:
path: node_modules
key: ${{ steps.version.outputs.hash }}
command: npm run ci
- name: Fire the webhook of AnnAngela's server
run: node scripts/fireWebhook/index.js
env:
Expand Down

0 comments on commit ec46eff

Please sign in to comment.