Skip to content

Commit

Permalink
chore(ci): rearrange ci, for better view of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jul 6, 2023
1 parent aa23e65 commit 66afb51
Show file tree
Hide file tree
Showing 28 changed files with 6,174 additions and 30,168 deletions.
64 changes: 64 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
env:
ENABLE_FEATURE_V4: "true"
SKIP_EXAMPLES: "true"
LOG_LEVEL: info

BUILD_TEST_TASK_TEMPLATE: &BUILD_TEST_TASK_TEMPLATE
arch_check_script:
- uname -am
build_script:
- node --version
- npx --yes absolute-version
- chmod +x scripts/ci/lib/prepare-release.sh
- chmod +x scripts/ci/build-and-test.sh && scripts/ci/build-and-test.sh
example_e2e_script:
- cd examples/e2e && npm install --ignore-scripts && npm test
example_graphql_script:
- cd examples/graphql && npm install --ignore-scripts && npm test
example_messages_script:
# - cd examples/jest && npm install --ignore-scripts && npm test
- cd examples/messages && npm install --ignore-scripts && npm test
example_serverless_script:
# - cd examples/mocha && npm install --ignore-scripts && npm test
- cd examples/serverless && npm install --ignore-scripts && npm test
example_typescript_script:
- cd examples/typescript && npm install --ignore-scripts && npm test
example_v3_e2e_script:
- cd examples/v3/e2e && npm install --ignore-scripts && npm test
example_v3_provider-state-injected_script:
- cd examples/v3/provider-state-injected && npm install --ignore-scripts && npm test
example_v3_run-specific-verifications_script:
- cd examples/v3/run-specific-verifications && npm install --ignore-scripts && npm test
example_v3_todo-consumer_script:
- cd examples/v3/todo-consumer && npm install --ignore-scripts && npm test
example_v3_typescript_script:
- cd examples/v3/typescript && npm install --ignore-scripts && npm test
example_v4_pluginsscript:
- cd examples/v4/plugins && npm install --ignore-scripts && npm test

linux_arm_task:
arm_container:
matrix:
- image: node:slim
- image: node:20-slim
- image: node:18-slim
- image: node:16-slim
cpu: 4
memory: 12G
setup_script: # Ideally we can remove libyaml-dev once resolved in traveling-ruby
- apt update --yes && apt install --yes jq git curl libyaml-dev
<< : *BUILD_TEST_TASK_TEMPLATE

macosx_arm_task:
env:
matrix:
NODE_VERSION: 20
NODE_VERSION: 18
NODE_VERSION: 16
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
setup_node__script: |
brew install nvm
source $(brew --prefix nvm)/nvm.sh
nvm install ${NODE_VERSION} && nvm use ${NODE_VERSION}
<< : *BUILD_TEST_TASK_TEMPLATE
82 changes: 47 additions & 35 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ env:
LOG_LEVEL: info

jobs:
build-and-test-ubuntu:
runs-on: ubuntu-latest
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x, 20.x]
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v3
Expand All @@ -27,50 +28,61 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: scripts/ci/build-and-test.sh
- run: bash scripts/ci/build-and-test.sh
shell: bash
env:
NODE_VERSION: ${{ matrix.node-version }}
SKIP_EXAMPLES: true
- name: Upload dist folder
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
path: dist

build-and-test-windows:
runs-on: windows-latest
examples:
needs: [build-and-test]
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16,18,20]
os: [macos-latest, ubuntu-latest, windows-latest]
example:
[
e2e,
graphql,
jest, # requires jest-pact updating
messages,
mocha, # requires mocha-pact updating
serverless,
typescript,
v3/e2e,
v3/provider-state-injected,
v3/run-specific-verifications,
v3/todo-consumer,
v3/typescript,
v4/plugins,
]
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download dist folder
uses: actions/download-artifact@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Fix node-gyp
run: |-
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
shell: pwsh
- run: bash scripts/ci/build-and-test.sh
- run: scripts/ci/test-examples
shell: bash
env:
NODE_VERSION: ${{ matrix.node-version }}

# Failures not reproducible locally on an M1 Mac
# build-and-test-macos:
# runs-on: macos-latest
# strategy:
# matrix:
# node-version: [14.x, 16.x, 18.x]
# fail-fast: false

# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# - run: scripts/ci/build-and-test.sh
# env:
# NODE_VERSION: ${{ matrix.node-version }}
SETUP_DIST_ONLY: true
if: matrix.example != 'jest' || matrix.example != 'mocha'
- run: bash scripts/install-plugins.sh
if: matrix.example == 'v4/plugins'
- name: run example ${{ matrix.example }}
run: |
npm install --ignore-scripts
npm test
shell: bash
working-directory: examples/${{ matrix.example }}

0 comments on commit 66afb51

Please sign in to comment.