Replace remaining CircleCI jobs with GHA (#3505)
Apparently the `build-docs` step is already happening, so we just need to port the schema and example validation jobs.
This commit is contained in:
parent
0982d5c55f
commit
0d8f466f39
2 changed files with 30 additions and 73 deletions
|
@ -1,73 +0,0 @@
|
||||||
gendoc: &gendoc
|
|
||||||
name: Generate the docs
|
|
||||||
# Note: Node dependencies are required for the hugo build.
|
|
||||||
# Note: We use a custom config file for circleci due to some specifics with hosting the
|
|
||||||
# site using CircleCI's artifacts platform. See config-circleci.toml for details.
|
|
||||||
command: |
|
|
||||||
apk add nodejs npm git hugo
|
|
||||||
npm i
|
|
||||||
cat config-circleci.toml config.toml > hugo-config.toml
|
|
||||||
hugo --config hugo-config.toml --baseURL "/${CIRCLE_NODE_INDEX}/public"
|
|
||||||
|
|
||||||
genswagger: &genswagger
|
|
||||||
name: Validate sources and generate swagger json
|
|
||||||
command: |
|
|
||||||
source /env/bin/activate
|
|
||||||
scripts/check-swagger-sources.py
|
|
||||||
scripts/dump-swagger.py
|
|
||||||
|
|
||||||
checkexamples: &checkexamples
|
|
||||||
name: Check Event Examples
|
|
||||||
command: |
|
|
||||||
source /env/bin/activate
|
|
||||||
scripts/check-event-schema-examples.py
|
|
||||||
|
|
||||||
validateapi: &validateapi
|
|
||||||
name: Validate OpenAPI specifications
|
|
||||||
command: |
|
|
||||||
cd scripts
|
|
||||||
npm install
|
|
||||||
node validator.js -s "../data/api/client-server"
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
jobs:
|
|
||||||
validate-docs:
|
|
||||||
docker:
|
|
||||||
- image: node:alpine
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run: *validateapi
|
|
||||||
check-docs:
|
|
||||||
docker:
|
|
||||||
- image: uhoreg/matrix-doc-build
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run: *checkexamples
|
|
||||||
build-docs:
|
|
||||||
docker:
|
|
||||||
- image: alpine
|
|
||||||
steps:
|
|
||||||
# Note: We install git in the image so we can pull git submodules. The hugo theme in use
|
|
||||||
# is a git submodule, which has its own submodules, and all need to be loaded.
|
|
||||||
- run: apk add git
|
|
||||||
- checkout
|
|
||||||
- run: git submodule update --init --recursive
|
|
||||||
- run: *gendoc
|
|
||||||
- store_artifacts:
|
|
||||||
path: public
|
|
||||||
- run:
|
|
||||||
name: "Doc build is available at:"
|
|
||||||
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/public/index.html"; echo $DOCS_URL
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
|
|
||||||
build-spec:
|
|
||||||
jobs:
|
|
||||||
- build-docs
|
|
||||||
- check-docs
|
|
||||||
- validate-docs
|
|
||||||
|
|
||||||
notify:
|
|
||||||
webhooks:
|
|
||||||
- url: https://giles.cadair.dev/circleci
|
|
30
.github/workflows/main.yml
vendored
30
.github/workflows/main.yml
vendored
|
@ -9,6 +9,36 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
validate-openapi:
|
||||||
|
name: "🔎 Validate OpenAPI specifications"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: "📥 Source checkout"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: "➕ Setup Node"
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- name: "⚙️ npm"
|
||||||
|
working-directory: "./scripts"
|
||||||
|
run: |
|
||||||
|
npm install
|
||||||
|
- name: "🔎 Run validator"
|
||||||
|
working-directory: "./scripts"
|
||||||
|
run: |
|
||||||
|
node validator.js -s "../data/api/client-server"
|
||||||
|
|
||||||
|
check-examples:
|
||||||
|
name: "🔎 Check Event schema examples"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: uhoreg/matrix-doc-build
|
||||||
|
steps:
|
||||||
|
- name: "📥 Source checkout"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: "🔎 Run validator"
|
||||||
|
run: |
|
||||||
|
/env/bin/python scripts/check-event-schema-examples.py
|
||||||
|
|
||||||
build-openapi:
|
build-openapi:
|
||||||
name: "🐍 Build OpenAPI definitions"
|
name: "🐍 Build OpenAPI definitions"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue