Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [push]
on:
push:
branches:
- main
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -54,7 +58,7 @@ jobs:

- name: Upload assets
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: platformify
path: ./dist/*
Expand Down Expand Up @@ -86,7 +90,7 @@ jobs:

- name: Upload assets
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: upsunify
path: ./dist/*
Expand Down
20 changes: 10 additions & 10 deletions validator/schema/upsun.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
"title": "Whether the preflight security blocks are enabled",
"description": "Must be a boolean",
"enum": [
"true",
"false"
true,
false
]
},
"ignored_rules": {
Expand Down Expand Up @@ -277,8 +277,8 @@
"title": "Whether to allow serving files which don’t match a rule",
"default": true,
"enum": [
"true",
"false"
true,
false
]
},
"headers": {
Expand Down Expand Up @@ -973,8 +973,8 @@
"description": "If set to true, HSTS is enabled for 1 year. \nIf set to false, other properties are ignored.",
"default": null,
"enum": [
"true",
"false"
true,
false
]
},
"include_subdomains": {
Expand All @@ -983,8 +983,8 @@
"description": "More information: \nhttps://docs.upsun.com/define-routes/https.html#enable-http-strict-transport-security-hsts",
"default": false,
"enum": [
"true",
"false"
true,
false
]
},
"preload": {
Expand All @@ -993,8 +993,8 @@
"description": "To add your website to the HSTS preload list: \nhttps://hstspreload.org/. \nThanks to this list, most browsers are informed that your site requires HSTS before an HSTS header response is even issued.\n",
"default": false,
"enum": [
"true",
"false"
true,
false
]
}
},
Expand Down
72 changes: 72 additions & 0 deletions validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,78 @@ services:
redis:
type: redis:6.2
size: AUTO
`,
),
},
},
},
wantErr: true,
},
{
name: "true-boolean",
args: args{
path: fstest.MapFS{
".upsun/config.yaml": &fstest.MapFile{
Data: []byte(`
applications:
app1:
type: "python:3.11"
preflight:
enabled: true
`,
),
},
},
},
wantErr: false,
},
{
name: "false-boolean",
args: args{
path: fstest.MapFS{
".upsun/config.yaml": &fstest.MapFile{
Data: []byte(`
applications:
app1:
type: "python:3.11"
preflight:
enabled: false
`,
),
},
},
},
wantErr: false,
},
{
name: "true-string-boolean",
args: args{
path: fstest.MapFS{
".upsun/config.yaml": &fstest.MapFile{
Data: []byte(`
applications:
app1:
type: "python:3.11"
preflight:
enabled: "true"
`,
),
},
},
},
wantErr: true,
},
{
name: "false-string-boolean",
args: args{
path: fstest.MapFS{
".upsun/config.yaml": &fstest.MapFile{
Data: []byte(`
applications:
app1:
type: "python:3.11"
preflight:
enabled: "false"
`,
),
},
Expand Down
Loading