Bump 0.0.4 (#306) #266
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: Examples | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["*"] | |
jobs: | |
build-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pixi | |
run: curl -fsSL https://pixi.sh/install.sh | bash && echo "$HOME/.pixi/bin" >> $GITHUB_PATH | |
- name: Build release | |
run: pixi run --manifest-path pixi.toml build-release | |
- name: Upload conda channel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-artifacts | |
path: | | |
/tmp/ecoscope-workflows/release/artifacts/ | |
!/tmp/ecoscope-workflows/release/artifacts/bld | |
!/tmp/ecoscope-workflows/release/artifacts/src_cache | |
if-no-files-found: error | |
compression-level: 0 | |
test-examples: | |
needs: build-release | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
example: [ | |
"patrol-events", | |
"patrols", | |
"subject-tracking", | |
] | |
deployment: [ | |
"local", | |
"docker", | |
] | |
api: [ | |
"app", | |
"cli", | |
] | |
execution-mode: [ | |
"async", | |
"sequential", | |
] | |
exclude: | |
# at this point, the docker container we are building runs the app only (not the cli) | |
# if we want to build a version of the container that runs the cli at a later point, | |
# we can do that, but for now, we are only testing the app in the container | |
- deployment: "docker" | |
api: "cli" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download conda channel | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-artifacts | |
path: /tmp/ecoscope-workflows/release/artifacts | |
- name: Log conda channel contents | |
run: ls -lR /tmp/ecoscope-workflows/release/artifacts | |
- name: Install pixi | |
run: curl -fsSL https://pixi.sh/install.sh | bash && echo "$HOME/.pixi/bin" >> $GITHUB_PATH | |
# 'local' deployment test ------------------------------------------------------------------- | |
- name: Test | |
if: matrix.deployment == 'local' | |
run: pixi run --manifest-path pixi.toml -e default pytest-${{ matrix.example }}-${{ matrix.api }} ${{ matrix.execution-mode }} | |
# 'docker' deployment test ------------------------------------------------------------------ | |
- name: Docker build + run | |
if: matrix.deployment == 'docker' | |
run: | | |
pixi run --manifest-path pixi.toml docker-build-${{ matrix.example }} | |
pixi run --manifest-path pixi.toml docker-run-${{ matrix.example }} | |
sleep 5 | |
docker ps | |
docker logs ${{ matrix.example }} | |
- name: Invoke container with curl | |
if: matrix.deployment == 'docker' | |
run: pixi run --manifest-path pixi.toml curl-invoke-${{ matrix.example }} ${{ matrix.execution-mode }} |