diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c2fd47..ad5ceb2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,20 +1,20 @@ name: CI/CD Pipeline +env: &env + GH_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + GH_COMMIT_HASH: ${{ github.event.head_commit.id }} + GH_COMMIT_LINK_URL: ${{ github.event.head_commit.url }} + GH_FULL_NAME: ${{ github.event.repository.full_name }} + GH_PROJECT_URL: ${{ github.event.repository.html_url }} + TRELLO_BOARD_ID: ${{ secrets.TRELLO_BOARD_ID }} + TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }} + TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }} + on: push: branches: - '*' jobs: - initial-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Run script file - run: | - env - echo "${{toJSON(github.event)}}" - shell: bash - pre-feature-pipeline: runs-on: ubuntu-latest steps: @@ -30,12 +30,21 @@ jobs: pip3 install requests - name: Run Python script run: python3 pipeline/pipeline.py --step pre_feature_branch - env: - GH_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} - GH_COMMIT_HASH: ${{ github.event.head_commit.id }} - GH_COMMIT_LINK_URL: ${{ github.event.head_commit.url }} - GH_FULL_NAME: ${{ github.event.repository.full_name }} - GH_PROJECT_URL: ${{ github.event.repository.html_url }} - TRELLO_BOARD_ID: ${{ secrets.TRELLO_BOARD_ID }} - TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }} - TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }} + env: *env + + unittest: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Test with pytest + run: | + pip install pytest pytest-cov + pytest tests.py --junitxml=results.xml + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: pytest-results + path: results.xml + needs: pre-feature-pipeline diff --git a/pipeline/ci-github.yaml b/pipeline/ci-github.yaml deleted file mode 100644 index 3cc166e..0000000 --- a/pipeline/ci-github.yaml +++ /dev/null @@ -1 +0,0 @@ -# Leer muss noch gemacht werden bspw. link \ No newline at end of file diff --git a/pipeline/ci-github.yaml b/pipeline/ci-github.yaml new file mode 120000 index 0000000..e90b635 --- /dev/null +++ b/pipeline/ci-github.yaml @@ -0,0 +1 @@ +../.github/workflows/main.yml \ No newline at end of file