Skip to content

Nightly CI Tests #13

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

Merged
merged 16 commits into from
Nov 15, 2024
Merged
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
46 changes: 41 additions & 5 deletions .github/workflows/nightly-js-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,57 @@
name: Firebase JS SDK Nightly

on:
schedule:
- cron: "0 0 * * *"
pull_request:
branches:
- main
workflow_dispatch:

jobs:
run:
name: Execute tests
name: Execute JS SDK Playwright tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Node (20)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "./node_modules"
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Write Project Config
env:
PROJECT_CONFIG: ${{ secrets.PROJECT_CONFIG }}
run: echo "export const firebaseConfig = $PROJECT_CONFIG;" > src/lib/app_tests/firebase.ts
- name: Yarn install
run: yarn
run: yarn --frozen-lockfile
- name: Restore yarn build cache
uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's in the .next/cache?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a build cache or Next. Nexst complains if you don't use it in CI enviornments, I guess, so I cached it!

# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea 🤔

I wonder if I can use this in the SDK repo to re-use archived builds from different commits if there are no source changes. Would cut down the majority of the workflow time.

# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you accidentally left a hanging - at the end here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it still matches the top key up until the second hasFiles. I actually copied this from "the manual", so it's legit!

- name: Yarn build
run: yarn build
- name: Restore cached playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('playwright.config.ts') }}
- name: Install Playwright browsers
run: yarn playwright install --with-deps
- name: Launch E2E tests workflow
run: |
echo Hello World (TBD)
run: yarn test