Skip to content

Commit

Permalink
workflow updates
Browse files Browse the repository at this point in the history
  • Loading branch information
couetilc committed Jan 19, 2025
1 parent 40a6736 commit 9461302
Show file tree
Hide file tree
Showing 6 changed files with 3,843 additions and 3,276 deletions.
15 changes: 11 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ updates:
schedule:
interval: "weekly"
groups:
production-dependencies:
dependency-type: "production"
development-dependencies:
dependency-type: "development"
dependencies:
patterns:
- "*"
ignore:
- dependency-name: "eslint"
- dependency-name: "eslint-config-prettier"
- dependency-name: "eslint-plugin-json"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
groups:
dependencies:
patterns:
- "*"
77 changes: 23 additions & 54 deletions .github/workflows/build_test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,29 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: false

- name: Get pnpm store directory
shell: bash
- name: Run Tests
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Install compatible testing library for older react versions
if: ${{ matrix.react-version }} < 18
run: pnpm add -D @testing-library/react@12

- name: Install React v${{ matrix.react-version }}
run: pnpm i react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}

- name: Test build
run: pnpm run build

- name: Test React v${{ matrix.react-version }}
run: pnpm test
set -x
react="react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}"
pnpm install
if test ${{ matrix.react-version }} -lt 18
then pnpm update $react @testing-library/react@12
else pnpm update $react @testing-library/react
fi
pnpm test
publish:
if: github.event_name == 'release' && github.event.action == 'published'
Expand All @@ -71,31 +53,18 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Publish
run: |
Expand Down
34 changes: 10 additions & 24 deletions .github/workflows/pr_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,18 @@ jobs:
name: Screenshot
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Take Screenshot
id: screenshot
Expand All @@ -49,6 +33,8 @@ jobs:
run: |
sha="$GITHUB_SHA"
pnpm install
git fetch origin
networks=$(
Expand Down Expand Up @@ -111,7 +97,7 @@ jobs:
echo "link_index=$link_index" >> $GITHUB_OUTPUT
- name: Comment on PR with screenshots
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const link_networks = '${{ steps.screenshot.outputs.link_networks }}'.split(',');
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.5.1
22.13.0
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,5 @@
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"packageManager": "pnpm@8.15.3"
}
"packageManager": "pnpm@10.0.0+sha512.b8fef5494bd3fe4cbd4edabd0745df2ee5be3e4b0b8b08fa643aa3e4c6702ccc0f00d68fa8a8c9858a735a0032485a44990ed2810526c875e416f001b17df12b"
}
Loading

0 comments on commit 9461302

Please sign in to comment.