Skip to content

Commit

Permalink
ci(github): migrate yarn to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
ratson committed May 20, 2023
1 parent 07e29de commit 907129d
Show file tree
Hide file tree
Showing 2 changed files with 43,642 additions and 95 deletions.
132 changes: 37 additions & 95 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,44 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 17.x]
node-version: [16, 18, 20]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
- os: macos-latest
node-version: 12.x
node-version: 12
- os: macos-latest
node-version: 14.x
node-version: 14
steps:
- name: Config git
run: git config --global core.autocrlf input

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Restore Node cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.eslintcache
yarn.lock
.yarnrc.yml
.yarn
node_modules
*/node_modules
*/*/node_modules
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}-${{ secrets.CACHE_VERSION }}

- name: Config Yarn
run: |
yarn set version berry
yarn --version
yarn set version from sources
yarn --version
yarn config set enableImmutableInstalls false
yarn config set pnpFallbackMode all
yarn config set pnpMode loose
if: hashFiles('.yarnrc.yml') == ''

- name: Install dependencies
run: |
yarn
- name: Build
run: |
pushd internal/rollup-config
yarn build
popd
yarn lerna run --stream prepublishOnly
run: pnpm install

- name: Test
run: |
yarn lint
yarn test
pnpm lint
pnpm test
shell: bash

test-android:
Expand All @@ -82,7 +63,7 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up JDK 1.8
uses: actions/setup-java@v2
Expand All @@ -91,31 +72,21 @@ jobs:
java-version: '8'

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Restore Node cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
yarn.lock
.yarn
node_modules
*/node_modules
*/*/node_modules
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}-${{ secrets.CACHE_VERSION }}

- name: Config Yarn
run: |
yarn set version berry
yarn set version from sources
yarn config set enableImmutableInstalls false
yarn config set pnpFallbackMode all
yarn config set pnpMode loose
- name: Restore Gradle cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
Expand All @@ -124,26 +95,24 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- uses: pnpm/action-setup@v2

- name: Install dependencies
run: |
echo "/usr/local/lib/android/sdk/platform-tools" >> $GITHUB_PATH
echo "/usr/local/lib/android/sdk/tools" >> $GITHUB_PATH
yarn
yarn prepare
yarn workspace '@admob-plus-internal/cli' prepack
yarn workspace '@admob-plus-internal/rollup-config' prepack
pushd examples/cordova
yarn prepare
yarn example cordova platform rm ios
pnpm cordova prepare
pnpm cordova platform rm ios
popd
#
- name: Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
script: |
cd examples/cordova
yarn test
# pnpm test
test-ios:
name: iOS on ${{ matrix.os }}
Expand All @@ -154,62 +123,49 @@ jobs:
os: [macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Restore Node cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
yarn.lock
.yarn
node_modules
*/node_modules
*/*/node_modules
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}-${{ secrets.CACHE_VERSION }}

- name: Config Yarn
run: |
yarn set version berry
yarn set version from sources
yarn config set enableImmutableInstalls false
yarn config set pnpFallbackMode all
yarn config set pnpMode loose
- uses: pnpm/action-setup@v2

- name: Install dependencies
run: |
yarn
yarn prepare
yarn workspace '@admob-plus-internal/cli' prepack
yarn workspace '@admob-plus-internal/rollup-config' prepack
pushd examples/cordova
yarn prepare
yarn example cordova platform rm android
pnpm cordova prepare
pnpm cordova platform rm android
popd
pushd examples/ionic3
touch yarn.lock
yarn
pnpm i
popd
- name: Test
run: |
yarn test-ios
pnpm test-ios
pushd examples/cordova
yarn test:ios
# pnpm test:ios
popd
pushd examples/ionic3
yarn build --prod
pnpm build --prod
popd
link-checker:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: lychee Link Checker
id: lc
uses: lycheeverse/lychee-action@v1
Expand All @@ -228,19 +184,13 @@ jobs:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Config Yarn
run: |
yarn set version berry
yarn set version from sources
yarn config set enableImmutableInstalls false
yarn config set pnpFallbackMode all
yarn config set pnpMode loose
- uses: pnpm/action-setup@v2

- uses: webfactory/ssh-agent@v0.5.4
with:
Expand All @@ -251,9 +201,7 @@ jobs:
git config --global user.name "${GIT_USER}"
git config --global user.email "${{ secrets.GH_EMAIL }}"
pushd website
yarn
yarn workspace 'admob-plus-cordova' build
yarn deploy
pnpm deploy
popd
env:
GIT_USER: "${{ secrets.GH_NAME }}"
Expand All @@ -269,12 +217,6 @@ jobs:
--config lychee.toml
fail: true

- name: Archive yarn.lock
uses: actions/upload-artifact@v2
with:
name: yarn.lock
path: yarn.lock

- uses: hkusu/status-create-action@v1
id: status-create
with:
Expand Down
Loading

0 comments on commit 907129d

Please sign in to comment.