mirror of
https://github.com/actions/deploy-pages.git
synced 2025-12-09 20:36:12 +00:00
update all workflow files to use the .node-version file in the root of the repo
This commit is contained in:
25
.github/workflows/check-dist.yml
vendored
25
.github/workflows/check-dist.yml
vendored
@@ -23,22 +23,37 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 16.x
|
# check the node version from the .node-version file
|
||||||
|
- name: fetch node version
|
||||||
|
id: node-version
|
||||||
|
run: |
|
||||||
|
version=$(cat .node-version)
|
||||||
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: ${{ steps.node-version.outputs.version }}
|
||||||
cache: npm
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Rebuild the dist/ directory
|
- name: rebuild the dist/ directory
|
||||||
run: npm run prepare
|
run: npm run prepare
|
||||||
|
|
||||||
- name: Compare the expected and actual dist/ directories
|
- name: compare the expected and actual dist/ directories
|
||||||
|
id: diff
|
||||||
run: |
|
run: |
|
||||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||||
echo "Detected uncommitted changes after build in dist folder. See status below:"
|
echo "Detected uncommitted changes after build in dist folder. See status below:"
|
||||||
git diff
|
git diff
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If index.js was different than expected, upload the expected version as an artifact
|
||||||
|
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3.1.2
|
||||||
|
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|||||||
17
.github/workflows/check-formatting.yml
vendored
17
.github/workflows/check-formatting.yml
vendored
@@ -21,14 +21,21 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.JS
|
# check the node version from the .node-version file
|
||||||
|
- name: fetch node version
|
||||||
|
id: node-version
|
||||||
|
run: |
|
||||||
|
version=$(cat .node-version)
|
||||||
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: ${{ steps.node-version.outputs.version }}
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Verify formatting
|
- name: verify formatting
|
||||||
run: npm run format:check
|
run: npm run format:check
|
||||||
|
|||||||
19
.github/workflows/check-linter.yml
vendored
19
.github/workflows/check-linter.yml
vendored
@@ -18,17 +18,24 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.JS
|
# check the node version from the .node-version file
|
||||||
|
- name: fetch node version
|
||||||
|
id: node-version
|
||||||
|
run: |
|
||||||
|
version=$(cat .node-version)
|
||||||
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: ${{ steps.node-version.outputs.version }}
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Verify linter
|
- name: verify linter
|
||||||
run: npm run lint:check
|
run: npm run lint:check
|
||||||
|
|||||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -9,7 +9,7 @@
|
|||||||
# the `language` matrix defined below to confirm you have the correct set of
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
# supported CodeQL languages.
|
# supported CodeQL languages.
|
||||||
#
|
#
|
||||||
name: 'CodeQL'
|
name: CodeQL
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|||||||
21
.github/workflows/rebuild-dependabot-prs.yml
vendored
21
.github/workflows/rebuild-dependabot-prs.yml
vendored
@@ -21,24 +21,31 @@ jobs:
|
|||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAGES_AUTOMATION_PAT }}
|
token: ${{ secrets.PAGES_AUTOMATION_PAT }}
|
||||||
|
|
||||||
- name: Setup Node.JS
|
# check the node version from the .node-version file
|
||||||
|
- name: fetch node version
|
||||||
|
id: node-version
|
||||||
|
run: |
|
||||||
|
version=$(cat .node-version)
|
||||||
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: ${{ steps.node-version.outputs.version }}
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Rebuild the dist/ directory
|
- name: rebuild the dist/ directory
|
||||||
run: npm run prepare
|
run: npm run prepare
|
||||||
|
|
||||||
- name: Commit any differences present in the dist/ directory
|
- name: commit any differences present in the dist/ directory
|
||||||
run: |
|
run: |
|
||||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||||
echo "Detected uncommitted changes after rebuild in dist folder. Committing..."
|
echo "Detected uncommitted changes after rebuild in dist folder. Committing..."
|
||||||
|
|||||||
19
.github/workflows/test.yml
vendored
19
.github/workflows/test.yml
vendored
@@ -13,17 +13,24 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.JS
|
# check the node version from the .node-version file
|
||||||
|
- name: fetch node version
|
||||||
|
id: node-version
|
||||||
|
run: |
|
||||||
|
version=$(cat .node-version)
|
||||||
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: ${{ steps.node-version.outputs.version }}
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run tests
|
- name: run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|||||||
Reference in New Issue
Block a user