Skip to content

Commit

Permalink
update workflow structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Nguyen Vu Hung committed Jul 24, 2024
1 parent 0dd10f8 commit 1edf162
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 31 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Coverage

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
container: python:3.8-slim

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
env:
AWS_DEFAULT_REGION: ap-southeast-1
run: |
coverage run -m unittest discover
coverage xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
env:
CODECOV_ENV: github-actions
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
name: Python Tests
name: Deploy

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
container: python:3.8-slim

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
env:
AWS_DEFAULT_REGION: ap-southeast-1
run: |
coverage run -m unittest discover
coverage xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
env:
CODECOV_ENV: github-actions
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
uses: ./.github/workflows/test.yml

deploy:
runs-on: ubuntu-latest
needs: test
runs-on: ubuntu-latest
environment: deploy-manual
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 5 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

[![codecov](https://codecov.io/gh/hungnv-sr/cloud-resume-challenge/graph/badge.svg?token=ZFFQHAQF8C)](https://codecov.io/gh/hungnv-sr/cloud-resume-challenge)
[![Build Status](https://github.com/hungnv-sr/cloud-resume-challenge/actions/workflows/cloud-resume-challenge.yml/badge.svg?branch=main)](https://github.com/hungnv-sr/cloud-resume-challenge/actions/workflows/cloud-resume-challenge.yml)
[![Coverage](https://github.com/hungnv-sr/cloud-resume-challenge/actions/workflows/coverage.yml/badge.svg?branch=main)](https://github.com/hungnv-sr/cloud-resume-challenge/actions/workflows/coverage.yml)
[![Deploy Status](https://github.com/hungnv-sr/cloud-resume-challenge/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/hungnv-sr/cloud-resume-challenge/actions/workflows/deploy.yml)

# cloud-resume-challenge
# AWS Cloud Resume Challenge

This is my take on [AWS Cloud Resume Challenge](https://cloudresumechallenge.dev/docs/the-challenge/aws/)

0 comments on commit 1edf162

Please sign in to comment.