-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at consolidating workflows (#292)
- Loading branch information
Showing
4 changed files
with
62 additions
and
138 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- deploy | ||
- "Build" | ||
branches: | ||
- main | ||
types: | ||
- completed | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
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/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
- name: Use GitVersion | ||
id: gitversion # step id used as reference for output values | ||
uses: gittools/actions/gitversion/[email protected] | ||
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 }}' | ||
- name: Download docker compose config | ||
run: wget https://raw.githubusercontent.com/TechlauncherFireApp/docker/main/docker-compose.frontend.yml | ||
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/techlauncherfireapp/backend:latest" | ||
replace: "ghcr.io/techlauncherfireapp/backend:${{ needs.version.outputs.version }}" | ||
find: "ghcr.io/${{ env.REPOSITORY_LC }}:latest" | ||
replace: "ghcr.io/${{ env.REPOSITORY_LC }}:${{ inputs.version }}" | ||
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 |