-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from coverallsapp/combined-pr-branch
Combined dependencies PR
- Loading branch information
Showing
12 changed files
with
2,669 additions
and
1,461 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,56 +2,43 @@ version: 2.1 | |
|
||
orbs: | ||
coveralls: coveralls/[email protected] | ||
node: circleci/node@1.1.6 | ||
node: circleci/node@5.1.0 | ||
|
||
jobs: | ||
build-1: | ||
executor: | ||
name: node/default | ||
|
||
executor: node/default | ||
steps: | ||
- checkout | ||
|
||
- node/with-cache: | ||
steps: | ||
- run: npm install | ||
- run: make test-coverage-1 | ||
|
||
- coveralls/upload: | ||
parallel: true | ||
flag_name: Test 1 | ||
verbose: true | ||
- checkout | ||
- node/install-packages | ||
- run: npm test -- test/run1.js | ||
- coveralls/upload: | ||
parallel: true | ||
flag_name: Test 1 | ||
verbose: true | ||
|
||
build-2: | ||
executor: | ||
name: node/default | ||
|
||
executor: node/default | ||
steps: | ||
- checkout | ||
|
||
- node/with-cache: | ||
steps: | ||
- run: npm install | ||
- run: make test-coverage-2 | ||
|
||
- coveralls/upload: | ||
parallel: true | ||
flag_name: Test 2 | ||
verbose: true | ||
- checkout | ||
- node/install-packages | ||
- run: npm test -- test/run2.js | ||
- coveralls/upload: | ||
parallel: true | ||
flag_name: Test 2 | ||
verbose: true | ||
|
||
done: | ||
executor: | ||
name: node/default | ||
executor: node/default | ||
|
||
steps: | ||
- coveralls/upload: | ||
parallel_finished: true | ||
carryforward: "Test 1,Test 2" | ||
- coveralls/upload: | ||
parallel_finished: true | ||
carryforward: "Test 1,Test 2" | ||
|
||
workflows: | ||
test_parallel_then_upload: | ||
jobs: | ||
- build-1 | ||
- build-2 | ||
- done: | ||
requires: [build-1, build-2] | ||
- build-1 | ||
- build-2 | ||
- done: | ||
requires: [ build-1, build-2 ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Standalone Coveralls Report | ||
|
||
on: [ pull_request ] | ||
|
||
# In this workflow we will: | ||
# - wait for all sibling workflows to finish | ||
# - download artifacts with coverage reports from `coveralls` workflow | ||
# - send acquired artifacts to Coveralls as single report | ||
jobs: | ||
report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Wait on tests (PR) | ||
uses: lewagon/[email protected] | ||
with: | ||
# NOTE: The ref value should be different when triggered by pull_request event. | ||
# See: https://github.com/lewagon/wait-on-check-action/issues/25. | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 # seconds | ||
running-workflow-name: report # the name of this job | ||
allowed-conclusions: success,skipped,cancelled,failure | ||
|
||
- name: Download artifact | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
github_token: ${{secrets.GITHUB_TOKEN}} | ||
pr: ${{github.event.pull_request.number}} | ||
workflow: coveralls.yml | ||
workflow_conclusion: success | ||
|
||
- uses: coverallsapp/github-action@v2 | ||
with: | ||
format: lcov | ||
debug: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,33 @@ | ||
name: Coveralls report | ||
on: | ||
push: | ||
pull_request: | ||
name: Test all platforms | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# NOTE: The ref value should be different when triggered by pull_request event. | ||
# See: https://github.com/lewagon/wait-on-check-action/issues/25. | ||
- name: Wait on tests (PR) | ||
uses: lewagon/[email protected] | ||
if: github.event_name == 'pull_request' | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 # seconds | ||
running-workflow-name: report # the name of this job | ||
allowed-conclusions: success,skipped,cancelled,failure | ||
test-linux: | ||
uses: ./.github/workflows/test.yml | ||
secrets: | ||
token: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
- name: Wait on tests (push) | ||
if: github.event_name != 'pull_request' | ||
uses: lewagon/[email protected] | ||
with: | ||
ref: ${{ github.sha }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 # seconds | ||
running-workflow-name: report # this job name | ||
allowed-conclusions: success,skipped,cancelled,failure | ||
test-macos: | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
os: macos | ||
secrets: | ||
token: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
- uses: coverallsapp/github-action@v2 | ||
env: | ||
COVERALLS_SERVICE_NUMBER: ${{ github.sha }} | ||
with: | ||
carryforward: "linux-1,linux-2,macos-2,macos-2,windows-1,windows-1" | ||
parallel-finished: true | ||
test-windows: | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
os: windows | ||
secrets: | ||
token: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
coveralls: | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
needs: [test-linux, test-macos, test-windows] | ||
steps: | ||
- uses: coverallsapp/github-action@v2 | ||
with: | ||
carryforward: "linux-1,linux-2,macos-2,macos-2,windows-1,windows-1" | ||
parallel-finished: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Reusable test workflow | ||
run-name: Run tests on ${{ inputs.os }} | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
build_id: | ||
type: string | ||
default: ${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} | ||
description: | | ||
Build identifier for the current run. This is sent as `service_number` to Coveralls. | ||
os: | ||
type: string | ||
default: ubuntu | ||
description: | | ||
The type of machine to run the job on. Can be one of 'ubuntu' (default), 'macos', or 'windows'. | ||
upload_coverage: | ||
type: boolean | ||
default: true | ||
description: | | ||
Whether to upload the coverage data to Coveralls. | ||
store_coverage: | ||
type: boolean | ||
default: true | ||
description: | | ||
Whether to store the coverage data as an artifact. | ||
secrets: | ||
token: | ||
required: true | ||
|
||
env: | ||
COVERALLS_SERVICE_NUMBER: ${{ inputs.build_id }} | ||
COVERALLS_REPO_TOKEN: ${{ secrets.token }} | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ inputs.os }}-latest | ||
strategy: | ||
matrix: | ||
test_number: [ 1, 2 ] | ||
outputs: | ||
build_id: ${{ inputs.build_id }} | ||
result: ${{ steps.coveralls.outputs.coveralls-api-result}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
- run: npm ci | ||
- run: npm test -- test/run${{ matrix.test_number }}.js | ||
- name: Coveralls | ||
id: coveralls | ||
if: ${{ inputs.upload_coverage }} | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel: true | ||
flag-name: ${{ inputs.os }}-${{ matrix.test_number }} | ||
debug: true | ||
- uses: actions/upload-artifact@v3 | ||
if: ${{ inputs.store_coverage }} | ||
with: | ||
name: coverage-data-${{ inputs.os }}-${{ matrix.test_number }} | ||
path: coverage/ |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
sudo: false | ||
--- | ||
os: linux | ||
dist: jammy | ||
|
||
language: node_js | ||
node_js: | ||
- "node" | ||
node_js: lts/* | ||
cache: | ||
directories: ~/.npm | ||
|
||
before_script: npm install -g npm@latest | ||
|
||
env: | ||
global: | ||
- COVERALLS_PARALLEL=true | ||
- COVERALLS_PARALLEL=true | ||
|
||
install: npm ci | ||
|
||
jobs: | ||
include: | ||
- script: COVERALLS_FLAG_NAME=test-1 make test-coveralls-1 | ||
- script: COVERALLS_FLAG_NAME=test-2 make test-coveralls-2 | ||
- script: npm test -- test/run1.js && COVERALLS_FLAG_NAME=test-1 npm run upload-coverage | ||
- script: npm test -- test/run2.js && COVERALLS_FLAG_NAME=test-2 npm run upload-coverage | ||
|
||
notifications: | ||
webhooks: https://coveralls.io/webhook |
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
Oops, something went wrong.