Skip to content

Commit

Permalink
update workflow to run on single job
Browse files Browse the repository at this point in the history
  • Loading branch information
zer0dss committed Jan 12, 2025
1 parent 0535cbb commit 4177e55
Showing 1 changed file with 2 additions and 32 deletions.
34 changes: 2 additions & 32 deletions .github/workflows/coopr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@ on:
push:
branches:
- '**'

workflow_dispatch:

jobs:
run-tasks:
build-and-test:
if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, 'coopr') || github.event_name == 'pull_request' }}
runs-on: self-hosted

steps:
- name: Checkout repository
uses: actions/checkout@v3

build-docker:
if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, 'coopr') || github.event_name == 'pull_request' }}
runs-on: self-hosted
needs: run-tasks

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -50,31 +40,11 @@ jobs:
cd /home/stefan/expectedparrot/coopr
docker-compose build --no-cache backend && docker-compose up --wait
run-make-coop-test:
if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, 'coopr') || github.event_name == 'pull_request' }}
runs-on: self-hosted
needs: build-docker

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Determine last commit hash for EDSL
id: get_edsl_commit
run: |
if [ "${{ github.head_ref }}" != "" ]; then
# Pull Request: Get the last commit from the source branch
echo "EDSL_COMMIT=$(git rev-parse ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
else
# Push: Get the last commit directly
echo "EDSL_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
fi
- name: Fetch and checkout last commit in EDSL
run: |
cd /home/stefan/expectedparrot/edsl
git fetch origin
git checkout -f $EDSL_COMMIT || git checkout -f origin/main # Fallback to main if commit is unavailable
git checkout -f $COMMIT || git checkout -f origin/main # Fallback to main if commit is unavailable
- name: Run make coop-test
run: |
Expand Down

0 comments on commit 4177e55

Please sign in to comment.