Skip to content

Commit

Permalink
Parallelize conformance test runs in CI (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
smaye81 committed Jun 19, 2024
1 parent 914fc0f commit 4464e71
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-web-ci-${{ hashFiles('Makefile') }}
key: ${{ runner.os }}-connect-es-ci-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-web-ci-
${{ runner.os }}-connect-es-ci-
- name: make
run: make && make checkdiff
run: make ci && make checkdiff
77 changes: 77 additions & 0 deletions .github/workflows/node-conformance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Node Conformance
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
node:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18, 20, 21]
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
with:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-node-conformance-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-node-conformance-
- name: testconnectnodeconformance
run: make testconnectnodeconformance
fastify:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18, 20, 21]
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
with:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-fastify-conformance-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-fastify-conformance-
- name: testconnectfastifyconformance
run: make testconnectfastifyconformance
express:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18, 20, 21]
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
with:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-express-conformance-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-express-conformance-
- name: testconnectexpressconformance
run: make testconnectexpressconformance
59 changes: 59 additions & 0 deletions .github/workflows/web-conformance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Web Conformance
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
chrome:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
with:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-web-chrome-conformance-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-web-chrome-conformance-
- name: testwebchromeconformance
run: make testwebchromeconformance
firefox:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
with:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-web-firefox-conformance-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-web-firefox-conformance-
- name: testwebfirefoxconformance
run: make testwebfirefoxconformance
safari:
runs-on: macos-12
steps:
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
with:
path: |
~/.tmp
.tmp
key: ${{ runner.os }}-connect-web-safari-conformance-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-connect-web-safari-conformance-
- name: testwebsafariconformance
run: make testwebsafariconformance
36 changes: 25 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $(BUILD)/connect-web: $(GEN)/connect-web $(BUILD)/connect $(BUILD)/connect-confo
@mkdir -p $(@D)
@touch $(@)

$(BUILD)/connect-conformance: $(BUILD)/connect $(GEN)/connect-conformance packages/connect-conformance/tsconfig.json $(shell find packages/connect-conformance/src -name '*.ts')
$(BUILD)/connect-conformance: $(GEN)/connect-conformance $(BUILD)/connect packages/connect-conformance/tsconfig.json $(shell find packages/connect-conformance/src -name '*.ts')
npm run -w packages/connect-conformance clean
npm run -w packages/connect-conformance build
@mkdir -p $(@D)
Expand Down Expand Up @@ -154,7 +154,10 @@ help: ## Describe useful make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'

.PHONY: all
all: build test format lint bench ## build, test, format, lint, and bench (default)
all: build test testconformance format lint bench ## build, test, testconformance, format, lint, and bench (default)

.PHONY: ci
ci: build test format lint bench ## build, test, format, lint, and bench (default)

.PHONY: clean
clean: ## Delete build artifacts and installed dependencies
Expand All @@ -165,7 +168,7 @@ clean: ## Delete build artifacts and installed dependencies
build: $(BUILD)/connect $(BUILD)/connect-web $(BUILD)/connect-node $(BUILD)/connect-fastify $(BUILD)/connect-express $(BUILD)/connect-next $(BUILD)/protoc-gen-connect-es $(BUILD)/example $(BUILD)/connect-migrate ## Build

.PHONY: test
test: testconnectpackage testconnectnodepackage testconnectwebpackage testconnectexpresspackage testconformance testconnectmigrate ## Run all tests, except browserstack
test: testconnectpackage testconnectnodepackage testconnectwebpackage testconnectexpresspackage testconnectmigrate ## Run all tests, except browserstack

.PHONY: testconnectpackage
testconnectpackage: $(BUILD)/connect
Expand All @@ -189,26 +192,37 @@ testconnectexpresspackage: $(BUILD)/connect-express
npm run -w packages/connect-express jasmine

.PHONY: testconformance
testconformance: testnodeconformance testwebconformance
testconformance: testconnectnodeconformance testconnectfastifyconformance testconnectexpressconformance testwebconformance

.PHONY: testnodeconformance
testnodeconformance: $(BUILD)/connect-conformance $(BUILD)/connect-node $(BUILD)/connect-fastify $(BUILD)/connect-express
.PHONY: testconnectnodeconformance
testconnectnodeconformance: $(BUILD)/connect-node
# Vanilla Node Server and Client
npm run -w packages/connect-node conformance

.PHONY: testconnectexpressconformance
testconnectexpressconformance: $(BUILD)/connect-express
# Express Server
npm run -w packages/connect-express conformance

.PHONY: testconnectfastifyconformance
testconnectfastifyconformance: $(BUILD)/connect-fastify
# Fastify Server
npm run -w packages/connect-fastify conformance

.PHONY: testwebconformance
testwebconformance: $(BUILD)/connect-conformance
testwebconformance: testwebchromeconformance testwebfirefoxconformance testwebsafariconformance

.PHONY: testwebchromeconformance
testwebchromeconformance: $(BUILD)/connect-web
npm run -w packages/connect-web conformance:client:chrome

.PHONY: testwebfirefoxconformance
testwebfirefoxconformance: $(BUILD)/connect-web
npm run -w packages/connect-web conformance:client:firefox
npm run -w packages/connect-web conformance:client:node
@# Requires one to enable the 'Allow Remote Automation' option in Safari's Develop menu.
ifeq ($(NODE_OS),darwin)

.PHONY: testwebsafariconformance
testwebsafariconformance: $(BUILD)/connect-web
npm run -w packages/connect-web conformance:client:safari
endif

.PHONY: testwebconformancelocal
testwebconformancelocal: $(BUILD)/connect-conformance
Expand Down

0 comments on commit 4464e71

Please sign in to comment.