This repository has been archived by the owner on Feb 24, 2025. It is now read-only.
a #52
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: Task1 QC | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
process_raw: | |
runs-on: self-hosted | |
steps: | |
- name: checkout code and return recently uploaded file in /data | |
uses: actions/checkout@v3 | |
- name: Get changed files | |
run: | | |
#!/bin/bash | |
# Get the list of CSV files changed in the last 24 hours | |
data=$(git log --since="24 hours ago" --name-only --pretty=format: -- '*.csv' | sort | uniq) | |
# Export the data variable to the environment | |
echo "data=$data" >> $GITHUB_ENV | |
# Print the changed CSV files | |
echo "Changed CSV files in the last 24 hours: $data" | |
- name: set up python | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: parse raw | |
run: | | |
#!/bin/bash | |
# Loop through each CSV file in $data | |
for file in $data; do | |
filename=$(basename "$file") | |
IFS='_' read -r sub task version <<< "$filename" | |
version="${version%.*}" | |
echo "sub=$sub" >> $GITHUB_ENV | |
echo "task=$task" >> $GITHUB_ENV | |
echo "version=$version" >> $GITHUB_ENV | |
echo "Subject: $sub" | |
echo "Task: $task" | |
echo "Version: $version" | |
done | |
run_qc: | |
runs-on: self-hosted | |
needs: process_raw | |
steps: | |
- name: run quality control | |
run: | | |
for sub in ${sub}; do | |
for task in ${task}; do | |
for vers in ${vers}; do | |
python ./code/AFqC.py -s ./data/${sub}/processed/${sub}_${task}_${vers}.csv -o ./data/${sub}/ -sub ${sub} | tee ./data/${sub}/qc_${task}_${vers}.log | |
done | |
done | |
done | |
push: | |
runs-on: self-hosted | |
needs: run_qc | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Commit and Push Changes | |
run: | | |
git config --global user.name "miloswrath" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -m "Automated commit by GitHub Actions" | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIT_PAT }} |