GAP-2521: bump out of date dependencies #889
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: Admin CI | |
on: | |
pull_request: | |
branches: | |
- develop | |
- feat/** | |
- feature/** | |
paths: | |
- "packages/admin/**" | |
- "packages/gap-web-ui/**" | |
- ".github/workflows/admin-ci.yml" | |
- "package.json" | |
- "yarn.lock" | |
jobs: | |
install: | |
name: Install dependencies | |
runs-on: ubuntu-latest | |
outputs: | |
gap-web-ui-hash: ${{ steps.gap-web-ui-hash.outputs.name }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Generate gap-web-ui hash | |
id: gap-web-ui-hash | |
run: | | |
NAME=${{ hashFiles('**/packages/gap-web-ui/**/*.js', '**/packages/gap-web-ui/**/*.jsx', '**/packages/gap-web-ui/**/*.ts', '**/packages/gap-web-ui/**/*.tsx') }} | |
echo "name=$NAME" >> $GITHUB_OUTPUT | |
- name: Read .nvmrc | |
id: nvm | |
run: echo "name=NVMRC::$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "${{ steps.nvm.outputs.NVMRC }}" | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Save node modules | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
${{ github.workspace }}/node_modules | |
${{ github.workspace }}/packages/admin/node_modules | |
key: ${{ github.sha }} | |
- name: Restore gap-web-ui cache | |
id: gap-web-ui-cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ github.workspace }}/packages/gap-web-ui/dist | |
key: gap-web-ui-${{ steps.gap-web-ui-hash.outputs.name }} | |
- name: Build gap-web-ui | |
if: steps.gap-web-ui-cache.outputs.cache-hit != 'true' | |
run: yarn workspace gap-web-ui build | |
- name: Save gap-web-ui cache | |
if: steps.gap-web-ui-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v3 | |
with: | |
path: ${{ github.workspace }}/packages/gap-web-ui/dist | |
key: gap-web-ui-${{ steps.gap-web-ui-hash.outputs.name }} | |
build: | |
name: Build app | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Generate source files hash | |
id: source-file-hash | |
run: | | |
NAME=${{ hashFiles('**/packages/admin/src/**/*.js', '**/packages/admin/src/**/*.jsx', '**/packages/admin/src/**/*.ts', '**/packages/admin/src/**/*.tsx') }} | |
echo "name=$NAME" >> $GITHUB_OUTPUT | |
- name: Generate yarn lock hash | |
id: yarn-lock-hash | |
run: | | |
NAME=${{ hashFiles('**/yarn.lock') }} | |
echo "name=$NAME" >> $GITHUB_OUTPUT | |
- name: Generate .env files | |
run: | | |
cp packages/admin/.env.example packages/admin/.env | |
sed -i -e '/TINYMCE_API_KEY=/s/$/${{ secrets.TINYMCE_API_KEY }}/g' packages/admin/.env | |
- name: Read .nvmrc | |
id: nvm | |
run: echo "name=NVMRC::$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "${{ steps.nvm.outputs.NVMRC }}" | |
cache: 'yarn' | |
- name: Restore gap-web-ui cache | |
id: gap-web-ui-cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ github.workspace }}/packages/gap-web-ui/dist | |
key: gap-web-ui-${{ needs.install.outputs.gap-web-ui-hash }} | |
- name: Restore node modules | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
${{ github.workspace }}/node_modules | |
${{ github.workspace }}/packages/admin/node_modules | |
key: ${{ github.sha }} | |
# Based on steps described here - https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions | |
- name: Next admin cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/packages/admin/.next/cache | |
key: admin-next-cache-${{ steps.yarn-lock-hash.outputs.name }}-${{ steps.source-file-hash.outputs.name }} | |
restore-keys: admin-next-cache-${{ steps.yarn-lock-hash.outputs.name }}- | |
- name: Build application | |
run: yarn workspace admin build | |
- name: Lint files | |
run: yarn workspace admin lint | |
test: | |
name: Test app | |
runs-on: ubuntu-latest | |
needs: install | |
strategy: | |
matrix: | |
shard: [1, 2, 3, 4] | |
fail-fast: false | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Generate gap-web-ui hash | |
id: gap-web-ui-hash | |
run: | | |
NAME=${{ hashFiles('**/packages/gap-web-ui/**/*.js', '**/packages/gap-web-ui/**/*.jsx', '**/packages/gap-web-ui/**/*.ts', '**/packages/gap-web-ui/**/*.tsx') }} | |
echo "name=$NAME" >> $GITHUB_OUTPUT | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'yarn' | |
- name: Restore node modules | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
${{ github.workspace }}/node_modules | |
${{ github.workspace }}/packages/admin/node_modules | |
key: ${{ github.sha }} | |
- name: Restore gap-web-ui cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ github.workspace }}/packages/gap-web-ui/dist | |
key: gap-web-ui-${{ steps.gap-web-ui-hash.outputs.name }} | |
- name: Generate .env files | |
run: | | |
cp packages/admin/.env.example packages/admin/.env | |
sed -i -e '/TINYMCE_API_KEY=/s/$/${{ secrets.TINYMCE_API_KEY }}/g' packages/admin/.env | |
- name: Run tests | |
run: yarn jest --selectProjects admin --runInBand --ci --shard=${{ matrix.shard }}/${{ strategy.job-total }} |