Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaked workflows #970

Merged
merged 14 commits into from
Jul 19, 2023
21 changes: 6 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
# continue-on-error: true
# steps:
# - uses: actions/checkout@v3
# - uses: ./.github/workflows/setupgo118amd64
# - uses: actions/setup-go@v4
# with:
# go-version-file: 'go.mod'
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# with:
Expand All @@ -27,25 +29,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setupgo118amd64
- uses: actions/setup-go@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better

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: Pull candid repo for test environment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests don't use it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It saves us 2 minutes on each run now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I'm with you, we use a test candid, I think I left this here in hopes we would run acceptance tests eventually though...

run: |
git clone https://github.com/canonical/candid.git ./tmp/candid
cd ./tmp/candid
DOCKER_BUILDKIT=1 \
docker build \
--cache-from candid:latest \
. -f ./Dockerfile -t candid
docker image ls candid
- name: Add volume files
run: |
touch ./local/vault/approle.json
touch ./local/vault/roleid.txt
- name: Start test environment
run: docker compose up -d
- name: Build and Test
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/oci-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- uses: ./.github/workflows/setupgo118amd64
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Setup version and commit
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/setupgo118amd64/action.yaml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- uses: ./.github/workflows/setupgo118amd64
- uses: actions/setup-go@v4
with:
user: ${{ secrets.GH_USER }}
pat: ${{ secrets.GH_AUTH }}
go-version-file: 'go.mod'
- run: sudo snap install snapcraft --channel=7.x/stable --classic
- run: mkdir -p snap
- run: cp ./snaps/jimm/snapcraft.yaml ./snap/snapcraft.yaml
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ clean:
-$(RM) -r jimm-release/
-$(RM) jimm-*.tar.xz

# Reformat source files.
# Reformat all source files.
format:
gofmt -w -l .

Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
traefik:
image: "traefik:2.9"
container_name: traefik
profiles: ["dev"]
ports:
- "80:80"
- "443:443"
Expand Down Expand Up @@ -93,6 +94,7 @@ services:
vault:
image: hashicorp/vault:latest
container_name: vault
profiles: ["dev"]
ports:
- 8200:8200
environment:
Expand Down Expand Up @@ -124,6 +126,7 @@ services:
image: candid:latest
container_name: candid
entrypoint: "/candid.sh"
profiles: ["dev"]
expose:
- 8081
ports:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/canonical/jimm

go 1.18
go 1.20

require (
github.com/canonical/candid v1.12.2
Expand Down
2 changes: 1 addition & 1 deletion internal/rpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestDialError(t *testing.T) {
d := *srv.dialer
d.TLSConfig = nil
_, err := d.Dial(context.Background(), srv.URL)
c.Assert(err, qt.ErrorMatches, `x509: certificate signed by unknown authority`)
c.Assert(err, qt.ErrorMatches, `.*x509: certificate signed by unknown authority`)
}

func TestDial(t *testing.T) {
Expand Down