Skip to content

Support CI without Faktory credentials #183

Support CI without Faktory credentials

Support CI without Faktory credentials #183

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: main
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: generate
uses: freckle/stack-action/generate-matrix@v4
outputs:
stack-yamls: ${{ steps.generate.outputs.stack-yamls }}
prep:
runs-on: ubuntu-latest
steps:
- id: prep
run: |
if [[ -n "$FAKTORY_REGISTRY_USERNAME" && -n "$FAKTORY_REGISTRY_PASSWORD" ]]; then
echo 'test-image=docker.contribsys.com/contribsys/faktory-ent:1.4.0'
else
echo 'test-image=contribsys/faktory:1.4.0'
echo 'test-arguments=--test-arguments="--skip Faktory.Ent"'
fi >>"$GITHUB_OUTPUT"
env:
FAKTORY_REGISTRY_USERNAME: ${{ secrets.FAKTORY_REGISTRY_USERNAME }}
FAKTORY_REGISTRY_PASSWORD: ${{ secrets.FAKTORY_REGISTRY_PASSWORD }}
outputs:
test-image: ${{ steps.prep.outputs.test-image }}
test-arguments: ${{ steps.prep.outputs.test-arguments }}
test:
needs:
- prep
- generate
runs-on: ubuntu-latest
services:
faktory:
image: ${{ needs.prep.outputs.test-image }}
credentials:
username: ${{ secrets.FAKTORY_REGISTRY_USERNAME }}
password: ${{ secrets.FAKTORY_REGISTRY_PASSWORD }}
ports:
- 7419:7419
strategy:
matrix:
stack-yaml: ${{ fromJSON(needs.generate.outputs.stack-yamls) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: freckle/stack-action@v5
with:
stack-build-arguments-test: ${{ needs.prep.outputs.test-arguments }}
env:
STACK_YAML: ${{ matrix.stack-yaml }}
FAKTORY_URL: tcp://localhost:7419
hlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/hlint-setup@v2
- uses: haskell-actions/hlint-run@v2
with:
fail-on: warning