This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
Add CI check #21
Workflow file for this run
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
# Copyright Jiaqi Liu | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
--- | |
name: CI/CD | |
"on": | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
validate: | |
name: Validating Template | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
template: [sd-template-basic.yaml, sd-template-ssl.yaml, sd-template-jpa.yaml] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Validate ${{ matrix.template }} | |
uses: satackey/action-js-inline@v0.0.2 | |
with: | |
required-packages: js-yaml screwdriver-data-schema | |
script: | | |
// Running screwdriver-template-main's template-validate CMD won't work because it's a over-the-wire | |
// validation against SD API which requires token authentication... (can't believe this) | |
// | |
// The API-based validation, by digging source code, essentially runs the following in API server: | |
const fs = require("fs"); | |
const error = require("screwdriver-data-schema").config.template.template | |
.validate(require('js-yaml').load(fs.readFileSync("${{ matrix.template }}"))).error | |
if (error) { | |
require('@actions/core').setFailed(error); | |
} |