-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
114 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,10 @@ jobs: | |
- uses: actions/[email protected] | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.14.0 | ||
|
||
- name: Cache bigger downloads | ||
uses: actions/[email protected] | ||
id: cache | ||
with: | ||
path: ${{ github.workspace }}/.cache | ||
key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
${{ runner.os }}- | ||
cache: 'npm' | ||
|
||
# Separate cache for build dir, we reuse it in release publish workflow | ||
- name: Cache build output | ||
|
@@ -37,7 +28,7 @@ jobs: | |
- name: Install dependencies | ||
# We only need to install deps if build isn't cached. | ||
if: steps.build-cache.outputs.cache-hit != 'true' | ||
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
run: npm ci --prefer-offline --no-audit --progress=false | ||
|
||
- name: Confirm build works | ||
if: steps.build-cache.outputs.cache-hit != 'true' | ||
|
@@ -47,6 +38,8 @@ jobs: | |
# - this is not for releases, but for quick testing during the dev | ||
# - action artifacts can be downloaded for 90 days, then are removed by github | ||
- name: Attach produced build to Github Action | ||
# only re-upload if we re-built | ||
if: steps.build-cache.outputs.cache-hit != 'true' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ipfs-webui_${{ github.sha }}-${{ runner.os }}-build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,15 +33,20 @@ jobs: | |
- uses: actions/[email protected] | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.14.0 | ||
cache: 'npm' | ||
|
||
- name: Download build artifact | ||
uses: actions/download-artifact@v3 | ||
- name: Cache build output | ||
uses: actions/[email protected] | ||
id: build-cache | ||
with: | ||
name: ipfs-webui_${{ github.sha }}-${{ runner.os }}-build | ||
path: build | ||
# Build hash should be based on runner.os, src files, and dependencies used. | ||
key: ${{ runner.os }}-build-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }} | ||
- name: Cache bigger downloads | ||
uses: actions/[email protected] | ||
|
@@ -232,12 +237,13 @@ jobs: | |
echo ${{ needs.publishPreview.outputs.cid }} > .cid | ||
- name: Setup node | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.14.0 | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
run: npm ci --prefer-offline --no-audit --progress=false | ||
|
||
- name: Download CAR artifact | ||
uses: actions/download-artifact@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,22 +9,13 @@ jobs: | |
- uses: actions/[email protected] | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.14.0 | ||
|
||
- name: Cache bigger downloads | ||
uses: actions/[email protected] | ||
id: cache | ||
with: | ||
path: ${{ github.workspace }}/.cache | ||
key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
${{ runner.os }}- | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
run: npm ci --prefer-offline --no-audit --progress=false | ||
|
||
- name: ESLint | ||
run: npm run eslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,12 @@ jobs: | |
if: github.ref == 'refs/heads/main' | ||
uses: RubbaBoy/BYOB@24f464284c1fd32028524b59607d417a2e36fee7 | ||
with: | ||
ICON: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg | ||
NAME: "node-${{ inputs.gh-node-version }}" | ||
LABEL: "${{ inputs.gh-node-version }}" | ||
STATUS: "Building..." | ||
COLOR: grey | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
icon: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg | ||
name: "node-${{ inputs.gh-node-version }}" | ||
label: "${{ inputs.gh-node-version }}" | ||
status: "Building..." | ||
color: grey | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
test-node: | ||
needs: [reset-badge] | ||
|
@@ -40,9 +40,10 @@ jobs: | |
- uses: actions/[email protected] | ||
|
||
- name: Use Node.js ${{ inputs.gh-node-version }} | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.gh-node-version }} | ||
cache: 'npm' | ||
|
||
- name: Remove .npmrc to allow non-strict engines | ||
run: | | ||
|
@@ -53,22 +54,12 @@ jobs: | |
run: | | ||
echo "version=$(node --version)" >> $GITHUB_OUTPUT | ||
- name: Cache bigger downloads | ||
uses: actions/[email protected] | ||
id: cache | ||
with: | ||
path: ${{ github.workspace }}/.cache | ||
key: ${{ runner.os }}-${{ inputs.gh-node-version }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ inputs.gh-node-version }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
${{ runner.os }}-${{ inputs.gh-node-version }} | ||
- name: Install node-pre-gyp | ||
run: | | ||
npm install node-pre-gyp --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
npm install node-pre-gyp --prefer-offline --no-audit --progress=false | ||
- name: Install dependencies | ||
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
run: npm install --progress=false | ||
|
||
- name: Confirm build works with Node.js ${{ inputs.gh-node-version }} on ${{ matrix.os }} | ||
run: npm run build | ||
|
@@ -82,20 +73,20 @@ jobs: | |
if: ${{ needs.test-node.result == 'success' && github.ref == 'refs/heads/main' }} | ||
uses: RubbaBoy/BYOB@24f464284c1fd32028524b59607d417a2e36fee7 | ||
with: | ||
ICON: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg | ||
NAME: "node-${{ inputs.gh-node-version }}" | ||
LABEL: "${{ needs.test-node.outputs.node-version }}" | ||
STATUS: ${{needs.test-node.result}} | ||
COLOR: green | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
icon: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg | ||
name: "node-${{ inputs.gh-node-version }}" | ||
label: "${{ needs.test-node.outputs.node-version }}" | ||
status: ${{needs.test-node.result}} | ||
color: green | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create failure badge | ||
if: ${{ needs.test-node.result != 'success' && github.ref == 'refs/heads/main' }} | ||
uses: RubbaBoy/BYOB@24f464284c1fd32028524b59607d417a2e36fee7 | ||
with: | ||
ICON: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg | ||
NAME: "node-${{ inputs.gh-node-version }}" | ||
LABEL: "${{ needs.test-node.outputs.node-version }}" | ||
STATUS: ${{needs.test-node.result}} | ||
COLOR: red | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
icon: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg | ||
name: "node-${{ inputs.gh-node-version }}" | ||
label: "${{ needs.test-node.outputs.node-version }}" | ||
status: ${{needs.test-node.result}} | ||
color: red | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,31 +9,32 @@ jobs: | |
- uses: actions/[email protected] | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.14.0 | ||
cache: 'npm' | ||
|
||
- name: Cache bigger downloads | ||
- name: Cache test-build output | ||
uses: actions/[email protected] | ||
id: cache | ||
id: test-build-cache | ||
with: | ||
path: ${{ github.workspace }}/.cache | ||
key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
path: build | ||
key: test-build-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
test-build-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }} | ||
- name: Cache test-build output | ||
- name: Cache node_modules | ||
uses: actions/[email protected] | ||
id: test-build-cache | ||
id: test-npm-cache | ||
with: | ||
path: build | ||
key: test-build-${{ runner.os }}-${{ github.sha }} | ||
path: node_modules | ||
key: test-npm-${{ runner.os }}-${{ github.sha }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', 'patches/**', '*.js', '*.ts') }} | ||
restore-keys: | | ||
test-build-${{ runner.os }}-${{ github.sha }} | ||
test-npm-${{ runner.os }}-${{ github.sha }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', 'patches/**', '*.js', '*.ts') }} | ||
- name: Install dependencies | ||
if: steps.test-npm-cache.outputs.cache-hit != 'true' | ||
run: npm ci --prefer-offline --no-audit --progress=false | ||
|
||
# This is required to ensure that our code is instrumented with coverage details | ||
- name: Run test build | ||
|
@@ -53,39 +54,43 @@ jobs: | |
- uses: actions/[email protected] | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.14.0 | ||
cache: 'npm' | ||
|
||
- name: Cache bigger downloads | ||
- name: Cache test-build output | ||
uses: actions/[email protected] | ||
id: cache | ||
id: test-build-cache | ||
with: | ||
path: ${{ github.workspace }}/.cache | ||
key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
path: build | ||
key: test-build-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
${{ runner.os }}- | ||
test-build-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }} | ||
- name: Install dependencies | ||
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
|
||
- name: Install playwright browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Cache test-build output | ||
# We don't want to re-install dependencies for every sharded run | ||
- name: Cache node_modules | ||
uses: actions/[email protected] | ||
id: test-build-cache | ||
id: test-npm-cache | ||
with: | ||
path: build | ||
key: test-build-${{ runner.os }}-${{ github.sha }} | ||
path: node_modules | ||
key: test-npm-${{ runner.os }}-${{ github.sha }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', 'patches/**', '*.js', '*.ts') }} | ||
restore-keys: | | ||
test-build-${{ runner.os }}-${{ github.sha }} | ||
test-npm-${{ runner.os }}-${{ github.sha }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', 'patches/**', '*.js', '*.ts') }} | ||
- name: Install dependencies | ||
if: steps.test-npm-cache.outputs.cache-hit != 'true' | ||
run: npm ci --prefer-offline --no-audit --progress=false | ||
|
||
# This is required to ensure that our code is instrumented with coverage details | ||
- name: Run test build | ||
if: steps.test-build-cache.outputs.cache-hit != 'true' | ||
run: npm run test:build | ||
# Cache playwright binaries | ||
- uses: actions/cache@v3 | ||
id: playwright-cache | ||
with: | ||
path: | | ||
~/.cache/ms-playwright | ||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }} | ||
- run: npm ci | ||
- run: npx playwright install --with-deps | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
|
||
- name: Cache nyc_output dir | ||
uses: actions/[email protected] | ||
|
@@ -104,6 +109,14 @@ jobs: | |
if: github.ref == 'refs/heads/main' # run non-duplicated tests on non-PRs | ||
run: npm run test:e2e -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | ||
|
||
- name: Store Artifacts from Failed Tests | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: test-results/ | ||
retention-days: 7 | ||
|
||
e2e-coverage: # since we run coverage in shards and some files may not contain coverage, we cache the .nyc_output directory | ||
name: 'e2e-coverage' | ||
runs-on: ubuntu-latest | ||
|
@@ -112,23 +125,10 @@ jobs: | |
- uses: actions/[email protected] | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3.6.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.14.0 | ||
|
||
- name: Cache bigger downloads | ||
uses: actions/[email protected] | ||
id: cache | ||
with: | ||
path: ${{ github.workspace }}/.cache | ||
key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }} | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm | ||
cache: 'npm' | ||
|
||
- name: Cache nyc_output dir | ||
uses: actions/[email protected] | ||
|
Oops, something went wrong.