Refactor #115
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: Run integration tests | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
environment-file: environment.yml | |
activate-environment: testenv | |
- name: Get the second-to-last commit hash | |
id: commit_hash | |
run: | | |
COMMIT_HASH=$(git log --format="%H" -n 2 | tail -n 1) | |
echo "COMMIT_HASH=${COMMIT_HASH}" >> $GITHUB_ENV | |
- name: read test_status.yaml | |
id: read_test_status | |
run: | | |
TEST_STATUS=$(cat test_status.yaml | grep "${COMMIT_HASH}" | cut -d ' ' -f 2|| echo "NOT FOUND") | |
echo "TEST_STATUS=${TEST_STATUS}" >> $GITHUB_ENV | |
- name: check test status | |
run: | | |
if [ "${TEST_STATUS}" == "NOT_FOUND" ]; then | |
echo "error: No entry found for the second-to-last commit in test_status.yaml." | |
exit 1 | |
elif [ "${TEST_STATUS}" != "PASS" ]; then | |
echo "error: The test_status.yaml file indicates a failure for the second-to-last commit." | |
exit 1 | |
fi |