chore: next 15 & react 19 #547
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: [develop] | |
push: | |
branches: [develop] | |
env: | |
CACHED_DEPENDENCY_PATHS: | | |
${{ github.workspace }}/.yarn/cache | |
${{ github.workspace }}/node_modules | |
${{ github.workspace }}/packages/*/node_modules | |
CACHED_BUILD_PACKAGE_UI_PATHS: ${{ github.workspace }}/packages/ui/dist | |
CACHED_BUILD_PACKAGE_CORE_PATHS: ${{ github.workspace }}/packages/core/dist | |
CACHED_GENERATED_STATIC_DATA_PATHS: ${{ github.workspace }}/apps/web/src/lib/assets/data | |
DEFAULT_NODE_VERSION: "v20.11.1" | |
DEFAULT_YARN_VERSION: "4.3.1" | |
jobs: | |
job_install_dependencies: | |
name: Install Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out current commit (${{ github.sha }}) | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.DEFAULT_NODE_VERSION }} | |
- name: Set up Yarn | |
run: | | |
corepack enable | |
yarn set version ${{ env.DEFAULT_YARN_VERSION }} | |
yarn --version | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Compute dependency cache key | |
id: compute_lockfile_hash | |
run: echo "hash=${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}" >> $GITHUB_OUTPUT | |
- name: Check dependency cache | |
uses: actions/cache@v4 | |
id: cache_dependencies | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
${{ env.CACHED_DEPENDENCY_PATHS }} | |
key: ${{ steps.compute_lockfile_hash.outputs.hash }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
if: steps.cache_dependencies.outputs.cache-hit != 'true' | |
run: yarn install --immutable | |
outputs: | |
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }} | |
yarn_cache_dir_path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
${{ env.CACHED_DEPENDENCY_PATHS }} | |
job_packages_build: | |
name: Build | |
needs: [job_install_dependencies] | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Check out current commit (${{ github.sha }}) | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.DEFAULT_NODE_VERSION }} | |
- name: Check dependency cache | |
id: cache-deps | |
uses: actions/cache@v4 | |
with: | |
path: ${{ needs.job_install_dependencies.outputs.yarn_cache_dir_path }} | |
key: ${{ needs.job_install_dependencies.outputs.dependency_cache_key }} | |
- name: Install dependencies | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
run: yarn install --immutable | |
- name: Compute @dnd-academy/core cache key | |
id: compute_core_cache_key | |
run: echo "hash=${{ runner.os }}-core-build-${{ hashFiles('packages/core/**') }}" >> $GITHUB_OUTPUT | |
- name: Check @dnd-academy/core build cache | |
uses: actions/cache@v4 | |
id: cache_built_core_packages | |
with: | |
path: ${{ env.CACHED_BUILD_PACKAGE_CORE_PATHS }} | |
key: ${{ steps.compute_core_cache_key.outputs.hash }} | |
- name: Build @dnd-academy/core | |
if: steps.cache_built_core_packages.outputs.cache-hit != 'true' | |
run: yarn workspace @dnd-academy/core build | |
- name: Compute @dnd-academy/ui cache key | |
id: compute_ui_cache_key | |
run: echo "hash=${{ runner.os }}-ui-build-${{ hashFiles('packages/ui/**') }}" >> $GITHUB_OUTPUT | |
- name: Check @dnd-academy/ui build cache | |
uses: actions/cache@v4 | |
id: cache_built_ui_packages | |
with: | |
path: ${{ env.CACHED_BUILD_PACKAGE_UI_PATHS }} | |
key: ${{ steps.compute_ui_cache_key.outputs.hash }} | |
- name: Build @dnd-academy/ui | |
if: steps.cache_built_ui_packages.outputs.cache-hit != 'true' | |
run: yarn workspace @dnd-academy/ui build | |
outputs: | |
build_package_core_cache_key: ${{ steps.compute_core_cache_key.outputs.hash }} | |
build_package_ui_cache_key: ${{ steps.compute_ui_cache_key.outputs.hash }} | |
job_generate_data: | |
name: Generate Data | |
needs: [job_install_dependencies, job_packages_build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out current commit (${{ github.sha }}) | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.DEFAULT_NODE_VERSION }} | |
- name: Check dependency cache | |
id: cache-deps | |
uses: actions/cache@v4 | |
with: | |
path: ${{ needs.job_install_dependencies.outputs.yarn_cache_dir_path }} | |
key: ${{ needs.job_install_dependencies.outputs.dependency_cache_key }} | |
- name: Install dependencies | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
run: yarn install --immutable | |
- name: Create environment variables | |
working-directory: apps/web | |
run: | | |
touch .env | |
echo GOOGLE_CLIENT_EMAIL = ${{ secrets.GOOGLE_CLIENT_EMAIL }} >> .env | |
echo GOOGLE_PRIVATE_KEY = ${{ secrets.GOOGLE_PRIVATE_KEY }} >> .env | |
- name: Check build core package cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CACHED_BUILD_PACKAGE_CORE_PATHS }} | |
key: ${{ needs.job_packages_build.outputs.build_package_core_cache_key }} | |
- name: Check build ui package cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CACHED_BUILD_PACKAGE_UI_PATHS }} | |
key: ${{ needs.job_packages_build.outputs.build_package_ui_cache_key }} | |
- name: Compute Generate Data cache key | |
id: compute_generate_data_cache_key | |
run: | | |
SCRIPTS_HASH=$(find apps/web/scripts -type f -exec sha256sum {} \; | sort | sha256sum | cut -d' ' -f1) | |
echo "hash=${{ runner.os }}-generate-data-${SCRIPTS_HASH}" >> $GITHUB_OUTPUT | |
- name: Check Generate Data cache | |
uses: actions/cache@v4 | |
id: cache_generated_data | |
with: | |
path: ${{ env.CACHED_GENERATED_STATIC_DATA_PATHS }} | |
key: ${{ steps.compute_generate_data_cache_key.outputs.hash }} | |
- name: Generate data | |
if: steps.cache_generated_data.outputs.cache-hit != 'true' | |
run: yarn generate:applicant-count | |
outputs: | |
generate_data_cache_key: ${{ steps.compute_generate_data_cache_key.outputs.hash }} | |
# continuous-integration: | |
# needs: [job_packages_build] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Set up Node | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: ${{ env.DEFAULT_NODE_VERSION }} | |
# - name: Check dependency cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: ${{ needs.job_packages_build.outputs.yarn_cache_dir_path }} | |
# key: ${{ needs.job_packages_build.outputs.dependency_cache_key }} | |
# - name: Check build package cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: ${{ env.CACHED_BUILD_PACKAGE_UI_PATHS }} | |
# key: ${{ needs.job_packages_build.outputs.build_package_ui_cache_key }} | |
# - name: Check Lint | |
# if: ${{ github.event_name == 'pull_request' }} | |
# run: | | |
# yarn lint | |
# yarn stylelint | |
# - name: Check Unit Test | |
# run: yarn test:coverage | |
job_publish_storybook_chromatic: | |
needs: [job_install_dependencies, job_packages_build, job_generate_data] | |
name: Chromatic Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out current commit (${{ github.sha }}) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.DEFAULT_NODE_VERSION }} | |
- name: Check dependency cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ needs.job_install_dependencies.outputs.yarn_cache_dir_path }} | |
key: ${{ needs.job_install_dependencies.outputs.dependency_cache_key }} | |
- name: Check build core package cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CACHED_BUILD_PACKAGE_CORE_PATHS }} | |
key: ${{ needs.job_packages_build.outputs.build_package_core_cache_key }} | |
- name: Check build ui package cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CACHED_BUILD_PACKAGE_UI_PATHS }} | |
key: ${{ needs.job_packages_build.outputs.build_package_ui_cache_key }} | |
- name: Check generate data cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CACHED_GENERATED_STATIC_DATA_PATHS }} | |
key: ${{ needs.job_generate_data.outputs.generate_data_cache_key }} | |
- name: Publish Project to Chromatic | |
uses: chromaui/action@latest | |
with: | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
workingDir: apps/web | |
skip: "dependabot/**" | |
exitOnceUploaded: true | |
onlyChanged: true | |
autoAcceptChanges: true | |
buildScriptName: "build:storybook" |