Merge pull request #8 from Knox-AAU/split-workflow-pullrequest_push #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-and-build | |
on: | |
push: | |
branches: ["**"] | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.12.0 | |
- name: Install dependencies | |
run: | | |
echo "Installing dependencies" | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
echo "Testing..." | |
python -m unittest || exit 1 | |
#Run all test | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.12.0 | |
- name: Install dependencies | |
run: | | |
echo "Installing dependencies" | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build both projects if test pass | |
run: | | |
echo "Building projects" | |
python3 relation_extraction/main.py | |
python3 concept_linking/main.py |