Skip to content

Delete Next.js Examples (#4308) #1238

Delete Next.js Examples (#4308)

Delete Next.js Examples (#4308) #1238

Workflow file for this run

name: on push
on:
push:
branches:
- master
env:
CACHE_PATH: |
**/node_modules
~/.cache/Cypress
~/.pnpm-store
FILES_TO_DELETE: |
sudo rm -rf "/usr/share/dotnet"
sudo rm -rf "/usr/share/swift"
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "/usr/local/lib/android/sdk"
sudo rm -rf "/opt/hostedtoolcache/Python"
sudo rm -rf "/opt/hostedtoolcache/go"
sudo rm -rf "/opt/hostedtoolcache/CodeQL"
sudo rm -rf "/var/lib/gems"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get clean -y
sudo apt-get autoremove -y
jobs:
# Stop previous runs
stop-previous-run:
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
# Create cache for all samples
cache:
runs-on: ubuntu-22.04
needs: stop-previous-run
outputs:
yarnHash: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Free up some space
run: ${{ env.FILES_TO_DELETE }}
# Hash pnpm-lock.yaml files to use it as a cache key, if pnpm-lock.yaml files are changed, the cache will be invalidated
- name: Check pnpm hash
id: yarn-hash
run: |
yarnHash="$(npx hash-files -f '["**/pnpm-lock.yaml"]' -a sha256)"
echo "yarnHash=$yarnHash" >> $GITHUB_OUTPUT
- name: Cache Yarn and Cypress
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ env.CACHE_PATH }}
key: e2e-cache-${{ steps.yarn-hash.outputs.yarnHash }}
- name: Install deps
if: steps.yarn-cache.outputs.cache-hit != 'true'
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: |
echo "Yarn changed - install deps ... "
pnpm install