Skip to content

Commit ec4e149

Browse files
committed
feat: add agola CI
1 parent f6f173f commit ec4e149

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Officially supported CI servers:
3434

3535
| Name | Constant | isPR |
3636
| ------------------------------------------------------------------------------- | ----------------------- | ---- |
37+
| [Agola CI](https://agola.io/) | `ci.AGOLA` ||
3738
| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | 🚫 |
3839
| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` ||
3940
| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) | `ci.AZURE_PIPELINES` ||

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const isPR: boolean | null;
2626
*/
2727
export const name: string | null;
2828

29+
export const AGOLA: boolean;
2930
export const APPCIRCLE: boolean;
3031
export const APPVEYOR: boolean;
3132
export const CODEBUILD: boolean;

test.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,44 @@ test('Gitea Actions', function (t) {
932932
t.end()
933933
})
934934

935+
test('Agola CI', function (t) {
936+
process.env.AGOLA_GIT_REF = 'true'
937+
process.env.AGOLA_PULL_REQUEST_ID = ''
938+
939+
clearModule('./')
940+
const ci = require('./')
941+
942+
t.equal(ci.isCI, true)
943+
t.equal(ci.isPR, false)
944+
t.equal(ci.name, 'Agola CI')
945+
t.equal(ci.AGOLA, true)
946+
assertVendorConstants('AGOLA', ci, t)
947+
948+
delete process.env.AGOLA_GIT_REF
949+
delete process.env.AGOLA_PULL_REQUEST_ID
950+
951+
t.end()
952+
})
953+
954+
test('Agola CI - PR', function (t) {
955+
process.env.AGOLA_GIT_REF = 'true'
956+
process.env.AGOLA_PULL_REQUEST_ID = '12'
957+
958+
clearModule('./')
959+
const ci = require('./')
960+
961+
t.equal(ci.isCI, true)
962+
t.equal(ci.isPR, true)
963+
t.equal(ci.name, 'Agola CI')
964+
t.equal(ci.AGOLA, true)
965+
assertVendorConstants('AGOLA', ci, t)
966+
967+
delete process.env.AGOLA_GIT_REF
968+
delete process.env.AGOLA_PULL_REQUEST_ID
969+
970+
t.end()
971+
})
972+
935973
function assertVendorConstants (expect, ci, t) {
936974
ci._vendors.forEach(function (constant) {
937975
let bool = constant === expect

vendors.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
[
2+
{
3+
"name": "Agola CI",
4+
"constant": "AGOLA",
5+
"env": "AGOLA_GIT_REF",
6+
"pr": "AGOLA_PULL_REQUEST_ID"
7+
},
28
{
39
"name": "Appcircle",
410
"constant": "APPCIRCLE",

0 commit comments

Comments
 (0)