Skip to content

Commit

Permalink
ci: add build and release jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Feb 5, 2024
1 parent 0ad9499 commit c3b4b6a
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,50 @@ jobs:
command: poetry run pylint prophecies

test-backend:
uses: ./.github/workflows/python_task.yml
with:
python-version: '["3.9", "3.10"]'
command: make test-back
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/python_task.yml
with:
python-version: '["3.9", "3.10"]'
command: make test-back

test-frontend:
uses: ./.github/workflows/node_task.yml
with:
node-version: '["16.x", "18.x"]'
command: make test-front

build:
runs-on: ubuntu-latest
needs: [lint-backend, test-backend, test-frontend]
steps:
- name: Save OpenAPI schema
uses: ./.github/workflows/python_task.yml
with:
python-version: '["3.9"]'
command: poetry run python manage.py spectacular --file ./openapi-$(poetry version --short)-${GITHUB_SHA}.yml

- name: Upload OpenAPI schema to artifacts
uses: actions/upload-artifact@v4
with:
name: openapi-schemas
path: |
./openapi-*.yml
release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Prepare release name
id: prep
run: echo "RELEASE_NAME=$(echo ${GITHUB_REF#refs/tags/v})" >> $GITHUB_ENV

- name: Download all OpenAPI schema artifacts
uses: actions/download-artifact@v4
with:
name: openapi-schemas

docker-publish:
needs: [lint-backend, test-backend, test-frontend]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
Expand Down

0 comments on commit c3b4b6a

Please sign in to comment.