Skip to content

Tools: Fix GitHub artifact upload #161

Tools: Fix GitHub artifact upload

Tools: Fix GitHub artifact upload #161

Workflow file for this run

name: CI Build and OpenAPI Spec Generation
on:
push:
branches:
- master
- feature/**
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js $14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: mkdir -p results
- run: npm ci
- run: npm run convert -- --output results/hcloud.json --schema_version ${GITHUB_SHA::7}-ci
- name: Archive generated specification
uses: actions/upload-artifact@v4
with:
name: specification
path: results/hcloud.json
validate:
needs: generate
runs-on: ubuntu-latest
strategy:
matrix:
openapi-version: [v4.3.1, latest]
steps:
- name: Download generated specification
uses: actions/download-artifact@v4
with:
name: specification
- run: docker run -v $GITHUB_WORKSPACE:/workspace -w /workspace openapitools/openapi-generator-cli:${{ matrix.openapi-version }} validate --input-spec ./specification/hcloud.json