-
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.
- Loading branch information
Showing
7 changed files
with
146 additions
and
124 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Standalone Coveralls Report | ||
|
||
on: [ pull_request ] | ||
|
||
# In this workflow: | ||
# - we wait for all sibling workflows to finish | ||
# - we download artifacts with coverage reports from those workflows | ||
# - 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}} | ||
workflow: coveralls-reusable.yml | ||
workflow_conclusion: success | ||
pr: ${{github.event.pull_request.number}} | ||
|
||
- uses: coverallsapp/github-action@v2 | ||
env: | ||
COVERALLS_SERVICE_NUMBER: ${{ github.sha }} | ||
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,36 +1,33 @@ | ||
name: Coveralls report | ||
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 }} | ||
|
||
test-macos: | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
os: macos | ||
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-windows: | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
os: windows | ||
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 | ||
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 | ||
|
||
install: npm ci | ||
|
||
jobs: | ||
include: | ||
- 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 |