-
Notifications
You must be signed in to change notification settings - Fork 42
86 lines (72 loc) · 2.42 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CI
on:
push:
branches:
- main
- next
pull_request:
jobs:
build:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 14
- 16
- 18
- 20
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install deps
run: npm ci
- name: Build dist
run: npm run build
- name: Run tests
run: npm test
action:
name: GitHub Action Dry Run
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub Action
uses: actions/checkout@v3
with:
path: rdme-repo
- name: Checkout external repo containing OpenAPI file
uses: actions/checkout@v3
with:
path: oas-examples-repo
repository: readmeio/oas-examples
# For every GitHub Action release, we deploy our Docker images
# to the GitHub Container Registry for performance reasons.
# Instead of testing against the pre-built image, we can build
# an image from the currently checked-out repo contents by doing a
# li'l update in the action.yml file to point to the current Dockerfile.
- name: Replace Docker image value in action.yml
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'image:.*'
replace: "image: 'Dockerfile'"
include: rdme-repo/action.yml
- name: Run `openapi:validate` command
uses: ./rdme-repo/
with:
rdme: openapi:validate oas-examples-repo/3.1/json/petstore.json
- name: Run `openapi:validate` with filename in quotes
uses: ./rdme-repo/
with:
rdme: openapi:validate "oas-examples-repo/3.1/json/petstore.json"
# Docs: https://rdme-test.readme.io
- name: Run `openapi` command
uses: ./rdme-repo/
with:
rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }}
- name: Run `openapi` command with weird arg syntax
uses: ./rdme-repo/
with:
rdme: openapi "oas-examples-repo/3.1/json/petstore.json" --key "${{ secrets.RDME_TEST_PROJECT_API_KEY }}" --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }}