diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 58454ce..4ce467a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,12 +1,10 @@ name: Publish Services to GHCR on: - push: - branches: - - main - pull_request: - branches: - - main + workflow_run: + workflows: [Test] + types: + - completed jobs: build: @@ -17,6 +15,7 @@ jobs: DASHBOARD_SERVICE_IMAGE_NAME: intersect-service STORAGE_SERVICE_IMAGE_NAME: intersect-storage + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c1871b7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + conda-version: "24.11.2" + auto-activate-base: false + + - name: Install dependencies + run: | + conda env create -f config/environment.yaml + conda run --no-capture-output -n espd_mantid pip install pytest + + - name: Run tests + run: | + conda run --no-capture-output -n espd_mantid python -m pytest