mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
9de0269080
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
135 lines
3.3 KiB
YAML
135 lines
3.3 KiB
YAML
name: unit-tests
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- 'dev*'
|
|
- 'releases/v*'
|
|
push:
|
|
branches:
|
|
- 'dev*'
|
|
tags-ignore:
|
|
- '*.*'
|
|
jobs:
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 'v16.13.2'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Install Yarn
|
|
run: npm install -g yarn
|
|
|
|
- name: Install and Test
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
yarn lint:check
|
|
yarn lint:format:check
|
|
yarn test
|
|
|
|
- name: Uploade CodeCov Report
|
|
uses: codecov/codecov-action@v3.1.4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 'v16.13.2'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Install Yarn
|
|
run: npm install -g yarn
|
|
|
|
- name: Build lib
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
yarn build
|
|
|
|
- name: Rebuild production node_modules
|
|
run: |
|
|
yarn install --production --frozen-lockfile
|
|
ls node_modules
|
|
|
|
- name: artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: dist
|
|
path: |
|
|
lib
|
|
node_modules
|
|
|
|
integration:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
strategy:
|
|
matrix:
|
|
branch: ['gh-pages', 'no-pages']
|
|
commit: ['singleCommit', 'add commits']
|
|
max-parallel: 1
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 'v16.13.2'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: dist
|
|
|
|
- name: Deploy
|
|
id: unmodified
|
|
uses: ./
|
|
with:
|
|
folder: integration
|
|
branch: ${{ matrix.branch }}
|
|
single-commit: ${{ matrix.commit == 'singleCommit' }}
|
|
dry-run: true
|
|
|
|
# Usually, this should be skipped, but if the upstream gh-pages
|
|
# branch doesn't match ours, it should still be a success.
|
|
- name: Check step output
|
|
run: |
|
|
[[ \
|
|
${{steps.unmodified.outputs.deployment-status}} = skipped || \
|
|
${{steps.unmodified.outputs.deployment-status}} = success \
|
|
]]
|
|
|
|
- name: Tweak content to publish to existing branch
|
|
if: ${{ matrix.branch == 'gh-pages' }}
|
|
run: |
|
|
echo "<!-- just sayin -->" >> integration/index.html
|
|
|
|
- name: Deploy with modifications to existing branch
|
|
id: modified
|
|
uses: ./
|
|
if: ${{ matrix.branch == 'gh-pages' }}
|
|
with:
|
|
folder: integration
|
|
branch: ${{ matrix.branch }}
|
|
single-commit: ${{ matrix.commit == 'singleCommit' }}
|
|
dry-run: true
|
|
|
|
# The modified deployment should be a success, and not skipped.
|
|
- name: Check step output
|
|
if: ${{ matrix.branch == 'gh-pages' }}
|
|
run: |
|
|
[[ \
|
|
${{steps.modified.outputs.deployment-status}} = success \
|
|
]]
|