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

Use locked major versions of GitHub actions #2779

Merged
merged 1 commit into from Jun 7, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/ci-setup/action.yml
@@ -0,0 +1,27 @@
name: 'CI setup'
runs:
using: 'composite'
steps:
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
shell: bash

- uses: actions/cache@v3
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn --frozen-lockfile
shell: bash
152 changes: 12 additions & 140 deletions .github/workflows/main.yml
Expand Up @@ -17,31 +17,8 @@ jobs:
- windows-latest
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0

- name: Set Node.js 12.x
uses: actions/setup-node@main
with:
node-version: 12.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: Run Tests
run: yarn test:ci --color
Expand All @@ -54,29 +31,8 @@ jobs:
name: Flow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Set Node.js 12.x
uses: actions/setup-node@main
with:
node-version: 12.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: Check Types
run: yarn flow:check
Expand All @@ -85,29 +41,8 @@ jobs:
name: Test React 18
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Set Node.js 12.x
uses: actions/setup-node@main
with:
node-version: 12.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: Run Tests with React 18
run: yarn test:react18:ci
Expand All @@ -116,29 +51,8 @@ jobs:
name: Test Dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Set Node.js 12.x
uses: actions/setup-node@main
with:
node-version: 12.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: Dist Tests
run: yarn test:prod
Expand All @@ -147,29 +61,8 @@ jobs:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Set Node.js 12.x
uses: actions/setup-node@main
with:
node-version: 12.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: ESLint
run: yarn lint:check
Expand All @@ -178,29 +71,8 @@ jobs:
name: dtslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Set Node.js 12.x
uses: actions/setup-node@main
with:
node-version: 12.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
run: yarn
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: dtslint
run: yarn test:typescript
19 changes: 3 additions & 16 deletions .github/workflows/release.yml
Expand Up @@ -13,24 +13,11 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Setup Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x

- name: Install Yarn
run: npm install --global yarn

- name: Install Dependencies
run: yarn --frozen-lockfile
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@master
uses: changesets/action@v1
with:
publish: yarn release
env:
Expand Down