Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: gnu tar for unzipping cache files on windows #5414

Merged
merged 6 commits into from
Jun 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 51 additions & 40 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ jobs:
with:
fetch-depth: 2

- name: Restore Cache
ovflowd marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/cache/restore@v3
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}-
restore-keys: cache-

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
cache: 'npm'

- name: Install NPM packages
run: npm ci

- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-
restore-keys: |
tests-${{ hashFiles('**/package-lock.json') }}-
enableCrossOsArchive: true

- name: Run Linting
run: npx turbo lint
env:
Expand All @@ -45,9 +45,10 @@ jobs:
uses: actions/cache/save@v3
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('node_modules/.cache') }}
enableCrossOsArchive: true
key: cache-${{ hashFiles('package-lock.json') }}

unit-tests:
name: Tests on ${{ matrix.os }}
Expand All @@ -59,30 +60,35 @@ jobs:
os: [ubuntu-latest, windows-latest]

steps:
- name: "Use GNU tar instead BSD tar"
if: matrix.os == 'windows-latest'
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}-
restore-keys: cache-

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
cache: 'npm'

- name: Install NPM packages
run: npm ci

- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-
restore-keys: |
tests-${{ hashFiles('**/package-lock.json') }}-
enableCrossOsArchive: true

- name: Run Unit Tests
run: npx turbo test:unit -- --coverage
env:
Expand All @@ -101,9 +107,10 @@ jobs:
uses: actions/cache/save@v3
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('node_modules/.cache') }}
enableCrossOsArchive: true
key: cache-${{ hashFiles('package-lock.json') }}

build:
name: Build on ${{ matrix.os }}
Expand All @@ -115,31 +122,35 @@ jobs:
os: [ubuntu-latest, windows-latest]

steps:
- name: "Use GNU tar instead BSD tar"
if: matrix.os == 'windows-latest'
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}-
restore-keys: cache-

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
cache: 'npm'

- name: Install NPM packages
run: npm ci

- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
.next/cache
node_modules/.cache
key: build-${{ hashFiles('**/package-lock.json') }}-
restore-keys: |
build-${{ hashFiles('**/package-lock.json') }}-
enableCrossOsArchive: true

- name: Build Next.js
run: npx turbo build
env:
Expand All @@ -152,7 +163,7 @@ jobs:
uses: actions/cache/save@v3
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: build-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('node_modules/.cache') }}
enableCrossOsArchive: true
key: cache-${{ hashFiles('package-lock.json') }}