Skip to content

Correct event name #150

Correct event name

Correct event name #150

Workflow file for this run

name: Test
on:
workflow_run:
workflows:
- build
- "Build"
types:
- completed
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.gitversion.outputs.semVer }}
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.6
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.6
with:
useConfigFile: true
showConfig: true
configFilePath: ./GitVersion.yml
- name: Display SemVer
run: |
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
smoke:
runs-on: ubuntu-latest
needs:
- version
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Lowercase Repository
run: |
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
env:
REPOSITORY: '${{ github.repository }}'
- run: |
if [[ "${{ github.event.workflow_run.event != 'pull_request' }}" == "true"]]; then

Check failure on line 48 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test.yml

Invalid workflow file

You have an error in your yaml syntax on line 48
echo "TAG=ghcr.io/${{ env.REPOSITORY_LC }}:${{ needs.version.outputs.version }}" >> $GITHUB_ENV
else
echo "TAG=ghcr.io/${{ env.REPOSITORY_LC }}:pr-${{ github.event.pull_requests[0].number }}" >> $GITHUB_ENV
fi
- name: Download docker compose config
run: wget https://raw.githubusercontent.com/${{ github.repository_owner }}/docker/main/docker-compose.frontend.yml
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "ghcr.io/${{ env.REPOSITORY_LC }}:latest"
replace: "${{ env.TAG }}"
regex: false
- name: Docker Compose version
run: docker compose version
- name: Start containers
run: docker compose -f "docker-compose.frontend.yml" up -d --wait
- name: Test container
run: docker run --network container:backend-fireapp-1 appropriate/curl -s --retry 10 --retry-connrefused http://localhost:5000/
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install snapd
run: |
sudo apt update
sudo apt install snapd
- name: Install MiniZinc
run: |
sudo snap install minizinc --classic
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install minizinc
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest