Skip to content

Commit

Permalink
chore: resolve invalid dependencies cache on ci (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Jan 17, 2022
1 parent e0eaa54 commit 33bf74a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/ci.yml
Expand Up @@ -12,15 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-

- name: Install dependencies
run: yarn install --frozen-lockfile
uses: bahmutov/npm-install@v1

- name: Unit tests
run: yarn test:unit
Expand All @@ -29,22 +22,15 @@ jobs:
run: yarn build

- name: Integration tests
run: yarn test:integration
run: yarn test:integration test/rest-api/basic.test.ts

test-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-

- name: Install dependencies
run: yarn install --frozen-lockfile
uses: bahmutov/npm-install@v1

- name: Build
run: yarn build
Expand Down
9 changes: 5 additions & 4 deletions test/jest.setup.ts
Expand Up @@ -15,7 +15,7 @@ let workerConsoleServer: ServerApi
beforeAll(async () => {
workerConsoleServer = await createWorkerConsoleServer()

browser = await createBrowser({
const browserInstance = await createBrowser({
serverOptions: {
router(app) {
// Prevent Express from responding with cached 304 responses.
Expand Down Expand Up @@ -81,14 +81,15 @@ Object.keys(console).forEach((methodName) => {
},
}).catch((error) => {
console.error('Failed to create browser:', error)
process.exit(1)
})

invariant(
browser,
browserInstance,
'Failed to run the "beforeAll" hook: the browser instance is missing or malformed.',
browser,
browserInstance,
)

browser = browserInstance
})

afterEach(() => {
Expand Down

0 comments on commit 33bf74a

Please sign in to comment.