From 86f12f7045805d52dabb1fdda916e0702a34f3d7 Mon Sep 17 00:00:00 2001 From: jteijema Date: Thu, 9 Jan 2025 17:55:22 +0100 Subject: [PATCH 1/4] update workflow to run in PRs --- .github/workflows/create-examples.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-examples.yml b/.github/workflows/create-examples.yml index 5a8b490..2f03f24 100644 --- a/.github/workflows/create-examples.yml +++ b/.github/workflows/create-examples.yml @@ -1,10 +1,10 @@ name: Update Examples on: - push: - branches: - - v.1.0.x - - main + pull_request: + types: + - synchronize + - opened jobs: update-examples: From 0a8db5d4f8cb058b2a17b6e0796634f6f1aaca49 Mon Sep 17 00:00:00 2001 From: Jelle Date: Mon, 3 Feb 2025 14:46:24 +0100 Subject: [PATCH 2/4] Explicitely check out PR branch --- .github/workflows/create-examples.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-examples.yml b/.github/workflows/create-examples.yml index 2f03f24..56d5111 100644 --- a/.github/workflows/create-examples.yml +++ b/.github/workflows/create-examples.yml @@ -13,7 +13,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - + with: + ref: ${{ github.head_ref }} + # Set up Python environment - name: Set up Python uses: actions/setup-python@v5 From bb92b06d4dc1456a8fcb1f1674e7f1ac4942085c Mon Sep 17 00:00:00 2001 From: Jelle Date: Mon, 3 Feb 2025 14:51:59 +0100 Subject: [PATCH 3/4] add token to workflow --- .github/workflows/create-examples.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-examples.yml b/.github/workflows/create-examples.yml index 56d5111..fa5d2a1 100644 --- a/.github/workflows/create-examples.yml +++ b/.github/workflows/create-examples.yml @@ -13,8 +13,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} # Set up Python environment - name: Set up Python @@ -45,6 +43,8 @@ jobs: # Check for changes, commit, and push - name: Commit and push changes if any + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" @@ -52,7 +52,7 @@ jobs: echo "Changes detected. Committing and pushing." git add -A git commit -m "Update examples" - git push + git push origin HEAD:${{ github.head_ref }} else echo "No changes detected. Skipping commit and push." fi From 8c8950a576f97e26be6ea4980e2f8286f928850d Mon Sep 17 00:00:00 2001 From: Jelle Date: Mon, 3 Feb 2025 14:55:03 +0100 Subject: [PATCH 4/4] remove the artifact uploading --- .github/workflows/ci-workflow.yml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 4fe141f..1d439de 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -29,14 +29,10 @@ jobs: ruff check . - name: Render makita templates run: | - asreview makita template basic -p basic -d .github/workflows/test_data/ --classifier nb --feature_extractor tfidf --query_strategy max --n_runs 1 --init_seed 1 --model_seed 2 --skip_wordclouds --overwrite --instances_per_query 2 --stop_if min --balance_strategy double | tee output_basic.txt - grep -q "ERROR" output_basic.txt && exit 1 || true - asreview makita template arfi -p arfi -d .github/workflows/test_data/ | tee output_arfi.txt - grep -q "ERROR" output_arfi.txt && exit 1 || true - asreview makita template prior -p prior -d .github/workflows/test_data/ | tee output_prior.txt - grep -q "ERROR" output_prior.txt && exit 1 || true - asreview makita template multimodel -p multimodel -d .github/workflows/test_data/ | tee output_multimodel.txt - grep -q "ERROR" output_multimodel.txt && exit 1 || true + asreview makita template basic -p basic -d .github/workflows/test_data/ --classifier nb --feature_extractor tfidf --query_strategy max --n_runs 1 --init_seed 1 --model_seed 2 --skip_wordclouds --overwrite --instances_per_query 2 --stop_if min --balance_strategy double || exit 1 + asreview makita template arfi -p arfi -d .github/workflows/test_data/ || exit 1 + asreview makita template prior -p prior -d .github/workflows/test_data/ || exit 1 + asreview makita template multimodel -p multimodel -d .github/workflows/test_data/ || exit 1 - name: Render makita scripts run: | asreview makita add-script --all -o ./tmp/scripts | tee output_scripts.txt @@ -55,14 +51,3 @@ jobs: scitree sh jobs.sh scitree - - name: Upload output files - if: always() - uses: actions/upload-artifact@v3 - with: - name: output-files - path: | - output_basic.txt - output_arfi.txt - output_prior.txt - output_multimodel.txt - output_scripts.txt \ No newline at end of file