-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.88 KB
/
ci_test.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
name: CI testing under construction
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
paths-ignore:
- '**.md'
branches: [ master ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
# schedule:
# - cron: '00 20 * * 0-5'
workflow_dispatch:
env:
# Use docker.io for Docker Hub if empty
#REGISTRY: ghcr.io
REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
TAG_LATEST: bullseye
OPENAPI_PKG: sample
MODULE_DIR: samples.1simple
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: adjust image name from ${{ github.repository }}
run: |
echo IMAGE_NAME=${{ env.IMAGE_NAME }} | sed 's/docker-//' >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
# Generates a openapi.yaml file based on the FastAPI project.
# https://github.com/column-st/fastapi-openapi-specs-action
- name: Generate OpenAPI file
uses: column-street/[email protected]
with:
moduleDir: ${{ env.MODULE_DIR }}
fileName: main.py
appName: app
outputName: ${{ env.OPENAPI_PKG }}-openapi
fastapiVersioning: v1
- name: Generate Python Client
uses: openapi-generators/[email protected]
with:
generator: python
openapi-file: ${{ env.OPENAPI_PKG }}-openapi.yaml
command-args: --package-name ${{ env.OPENAPI_PKG }} -o ${{ env.OPENAPI_PKG }}-client --generate-alias-as-model
- name: print all files (after codegen)
run: |
find . | grep -v /.git/ | xargs ls -lrtd