Skip to content

Css 6646/sessions #1543

Css 6646/sessions

Css 6646/sessions #1543

Workflow file for this run

name: CI
on:
pull_request:
workflow_call:
workflow_dispatch:
jobs:
# lint:
# runs-on: ubuntu-20.04
# continue-on-error: true
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# go-version-file: 'go.mod'
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# with:
# # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
# version: latest
# skip-pkg-cache: true
# skip-build-cache: true
build_test:
name: Build and Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Install dependencies
run: sudo apt-get update -y && sudo apt-get install -y gcc git-core gnupg build-essential
- name: Remove installed mongodb
run: sudo apt purge mongodb-org && sudo apt autoremove
- run: sudo snap install juju-db --channel 4.4/stable
- name: Add volume files
run: |
touch ./local/vault/approle.json
touch ./local/vault/roleid.txt
- name: Start test environment
run: docker compose up -d --wait
- name: Build and Test
run: go test -mod readonly ./... -timeout 1h -cover
env:
JIMM_DSN: postgresql://jimm:jimm@localhost:5432/jimm
JIMM_TEST_PGXDSN: postgresql://jimm:jimm@localhost:5432/jimm
PGHOST: localhost
PGPASSWORD: jimm
PGSSLMODE: disable
PGUSER: jimm
PGPORT: 5432
smoke_test:
name: Smoke Test
runs-on: ubuntu-22.04
# The docker compose has a healthcheck on the JIMM container.
# So if the compose returns with exit code 0 then the JIMM server successfully started.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Pull candid repo for test environment
run: |
git clone https://github.com/canonical/candid.git ./tmp/candid
cd ./tmp/candid
make image
docker image ls candid
- name: Add volume files
run: |
touch ./local/vault/approle.json
touch ./local/vault/roleid.txt
- run: go version
- run: go mod vendor
- run: docker compose --profile dev up -d --wait --timestamps