Skip to content

Commit

Permalink
Update CI workflow to run on branches and forks
Browse files Browse the repository at this point in the history
  • Loading branch information
L1ghtmann committed Jan 11, 2024
1 parent 4bd3d2c commit b2c9999
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: tests
name: Tests

on:
push:
paths-ignore:
- '**/*.md'
- '**/*.txt'
branches:
- master
- 'dev/**'
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
branches:
- master
- 'dev/**'

jobs:
tests:
Expand All @@ -41,8 +35,17 @@ jobs:

- name: Install dependencies
run: |
# Checkout relevant repo (e.g., main repo branch or fork)
REPO=${{ github.event.pull_request.head.repo.full_name }}
REF=${{ github.event.pull_request.head.ref }}
if [[ -z "$REPO" ]]; then
REPO=${{ github.repository }}
REF=${{ github.ref }}
fi
python -m pip install --upgrade pip
pip install "git+https://github.com/dragonbuild/dragon"
pip install "git+https://github.com/$REPO@$REF"
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install dragon
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<br>
<br>
<a href="https://github.com/dragonbuild/dragon/actions/workflows/tests.yml">
<image src="https://github.com/dragonbuild/dragon/actions/workflows/tests.yml/badge.svg">
<image src="https://github.com/dragonbuild/dragon/actions/workflows/tests.yml/badge.svg?branch=master">
</a>
<a href="https://dragon.cynder.me">
<image src="https://readthedocs.org/projects/dragon/badge/?version=latest">
Expand Down Expand Up @@ -60,7 +60,7 @@ pip3 install --force-reinstall dragon

<p align=center>
<img src=".github/vri.png" alt="vri" width=110px>
</p>
</p>
<p align=center>
a project by cynder
</p>
Expand Down

0 comments on commit b2c9999

Please sign in to comment.