Feature/51 frontend user preferences #327
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: Backend CI | |
on: | |
push: | |
paths: | |
- 'backend/**' | |
- '.github/workflows/backend_ci.yml' | |
pull_request: | |
paths: | |
- 'backend/**' | |
- '.github/workflows/backend_ci.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: backend | |
strategy: | |
matrix: | |
go-version: [ '1.22.x' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache-dependency-path: "backend/go.sum" | |
- name: Build Swagger | |
run: | | |
go install github.com/swaggo/swag/cmd/swag@latest | |
swag init -g handler.go | |
- name: Go Build | |
run: go build -v ./... | |
- name: Go Test | |
run: go test | |
pre-integration: | |
runs-on: ubuntu-latest | |
needs: build | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
concurrent_skipping: 'same_content_newer' | |
skip_after_successful_duplicate: 'true' | |
integration-test: | |
needs: pre-integration | |
if: needs.pre-integration.outputs.should_skip != 'true' | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: backend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start Cosmos Emulator | |
uses: janpio/cosmos-emulator-github-action@main | |
with: | |
parameter_string: "-Timeout 420" | |
- name: Start Azurite | |
id: azuright | |
uses: potatoqualitee/[email protected] | |
- name: Set up node (for Azure Functions Core Tools) | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Set up Go 1.22 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
cache-dependency-path: "backend/go.sum" | |
- name: Build Swagger | |
run: | | |
go install github.com/swaggo/swag/cmd/swag@latest | |
swag init -g handler.go | |
- name: Install Azure Functions Core Tools | |
run: | | |
npm i -g [email protected] --unsafe-perm true | |
func --version | |
- name: Install python dependencies | |
run: pip install -r test/requirements.txt | |
- name: Build backend | |
run: | | |
mkdir bin | |
go build -o bin/handler . | |
Copy-Item -Path test/test.settings.json -Destination local.settings.json | |
Copy-Item -Path test/listingPreferenceMatchTrigger__function.json -Destination listingPreferenceMatchTrigger/function.json | |
- name: Prepare db/container for test | |
run: cd test; python prepare_fixture.py | |
- name: Run integration tests | |
run: cd test; pytest --junit-xml=test-results.xml | |
- name: Upload test results | |
if: success() || failure() | |
uses: mikepenz/action-junit-report@v4 | |
with: | |
report_paths: '**/test-results.xml' | |
check_name: 'Integration Test Report' | |
check_title_template: 'Integration Test Report' |