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: update actions #3986

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
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
67 changes: 31 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,32 @@ jobs:
name: 'determine changes'
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changed-files-yaml.outputs.src_any_changed }}
changes: ${{ steps.changed-files-yaml.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Detect changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v39
uses: tj-actions/changed-files@v45
with:
files_yaml: |
src:
- packages/formik/src/**
- packages/formik/package.json
- packages/formik-native/src/**
- packages/formik-native/package.json
files: |
.github/workflows/ci.yml
packages/formik/src/**
packages/formik/package.json
packages/formik-native/src/**
packages/formik-native/package.json

benchmark:
if: needs.detectChangedSourceFiles.outputs.changes == 'true'
if: always() && needs.detectChangedSourceFiles.outputs.changes == 'true'
needs: detectChangedSourceFiles
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: yarn
node-version-file: .nvmrc

- name: Detect changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v39
with:
files_yaml: |
src:
- packages/formik/src/**
- packages/formik-native/src/**

- name: Install & build
run: |
node --version
Expand All @@ -54,7 +45,7 @@ jobs:
yarn build:benchmark

- name: Download previous benchmark data
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./benchmark-cache
key: ${{ runner.os }}-benchmark
Expand All @@ -78,13 +69,15 @@ jobs:
fail-threshold: 120%
# needed for commenting on PRs
github-token: ${{ secrets.GITHUB_TOKEN }}

interaction:
if: needs.detectChangedSourceFiles.outputs.changes == 'true'
needs: detectChangedSourceFiles
if: always() && needs.detectChangedSourceFiles.outputs.changes == 'true'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
node-version-file: .nvmrc
Expand All @@ -97,7 +90,7 @@ jobs:
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV

- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
Expand All @@ -112,31 +105,33 @@ jobs:

- name: Run Playwright tests
run: yarn playwright test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 5

size:
if: needs.detectChangedSourceFiles.outputs.changes == 'true'
needs: detectChangedSourceFiles
if: always() && needs.detectChangedSourceFiles.outputs.changes == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
build-script: 'turbo run build --filter {./packages/*}...'

unit:
if: needs.detectChangedSourceFiles.outputs.changes == 'true'
needs: detectChangedSourceFiles
if: always() && needs.detectChangedSourceFiles.outputs.changes == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
node-version-file: .nvmrc
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'jaredpalmer/formik'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: yarn
node-version-file: .nvmrc
Expand All @@ -22,7 +22,7 @@ jobs:
run: yarn install

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@master
uses: changesets/action@1.4.8
with:
publish: yarn release
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"lint-staged": "^10.4.0",
"prettier": "^2.1.2",
"react-hook-form": "^7.45.0",
"ts-node": "^10.9.1",
"tslib": "^2.5.3",
"tsx": "^4.19.0",
"turbo": "^1.9.9"
},
"workspaces": [
Expand All @@ -43,7 +43,7 @@
"precommit": "lint-staged",
"e2e:ui": "playwright test --ui",
"start:app": "turbo run build --filter formik... && yarn --cwd packages/formik link && yarn --cwd ./app link formik && yarn --cwd ./app && yarn --cwd ./app run dev",
"benchmark": "ts-node scripts/benchmark.tsx | tee output.txt"
"benchmark": "tsx scripts/benchmark.tsx | tee output.txt"
},
"lint-staged": {
"**/*.{ts,tsx,md,mdx,js,jsx}": [
Expand Down
14 changes: 7 additions & 7 deletions scripts/benchmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import { renderToString } from 'react-dom/server';
import { useFieldArray, useForm } from 'react-hook-form';
import * as yup from 'yup';

const schema = yup.object({
firstName: yup.string().required(),
lastName: yup.string().required(),
email: yup.string().email().required(),
guests: yup.array(yup.object({ name: yup.string().required() })).ensure(),
});

const suite = new Benchmark.Suite({ initCount: 50 });

suite
Expand All @@ -23,13 +30,6 @@ suite
})
.run();

const schema = yup.object({
firstName: yup.string().required(),
lastName: yup.string().required(),
email: yup.string().email().required(),
guests: yup.array(yup.object({ name: yup.string().required() })).ensure(),
});

// generic Formik implementation
function FormikSimpleExample() {
return (
Expand Down
4 changes: 0 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,5 @@
"formik-native": ["./packages/react-native/src"],
"$test/*": ["test/*"]
}
},
"ts-node": {
"esm": true,
"transpileOnly": true
}
}
Loading
Loading