Skip to content

Commit

Permalink
Merge branch 'main' into host-waitforsql
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Jul 5, 2022
2 parents 889a45b + b5ff9a2 commit ec477cb
Show file tree
Hide file tree
Showing 82 changed files with 6,860 additions and 1,007 deletions.
6 changes: 0 additions & 6 deletions .dependabot/config.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: "/e2e"
schedule:
interval: daily
open-pull-requests-limit: 3
rebase-strategy: disabled
68 changes: 68 additions & 0 deletions .github/workflows/ci-podman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Podman pipeline

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.x]
runs-on: ubuntu-22.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Enable systemd user process
run: |
loginctl enable-linger $(whoami)
sleep 1
- name: Set XDG_RUNTIME_DIR
run: echo "XDG_RUNTIME_DIR=/run/user/$UID" >> $GITHUB_ENV

- name: Install Podman
run: |
set -x
sudo apt-get remove -y podman docker-ce docker docker-engine docker.io containerd runc ||:
sudo apt update
sudo apt install -y software-properties-common debian-archive-keyring dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
sudo add-apt-repository -y "deb http://deb.debian.org/debian experimental main"
sudo apt update
sudo apt -y -t experimental install podman crun docker-compose
sudo systemctl daemon-reload
sleep 5
sudo systemctl start podman.socket
sudo podman info
- name: Set DOCKER_HOST
run: echo "DOCKER_HOST=unix:///run/podman/podman.sock" >> $GITHUB_ENV

- name: modVerify
run: go mod verify

- name: modTidy
run: go mod tidy

- name: gotestsum
# only run tests on linux, there are a number of things that won't allow the tests to run on anything else
# many (maybe, all?) images used can only be build on Linux, they don't have Windows in their manifest, and
# we can't put Windows Server in "Linux Mode" in Github actions
# another, host mode is only available on Linux, and we have tests around that, do we skip them?
run: sudo make test-unit

- name: modTidy e2e tests
run: make -C e2e tools-tidy

- name: Run e2e tests
run: sudo make test-e2e

- name: Run checker
run: |
./scripts/check_environment.sh
33 changes: 20 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on: [push, pull_request]

jobs:
static-analysis:
runs-on: [ubuntu-latest]
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run ShellCheck
run: |
shellcheck scripts/*.sh
Expand All @@ -18,24 +18,19 @@ jobs:
test:
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.x]
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.x]
platform: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
go get gotest.tools/gotestsum
uses: actions/checkout@v3

- name: modVerify
run: go mod verify
Expand All @@ -57,12 +52,24 @@ jobs:
# we can't put Windows Server in "Linux Mode" in Github actions
# another, host mode is only available on Linux, and we have tests around that, do we skip them?
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: gotestsum --format short-verbose -- -coverprofile=cover.txt ./...
run: make test-unit

# only report code coverage on linux
- name: Upload coverage report
if: ${{ matrix.platform == 'ubuntu-latest' }}
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
file: ./cover.txt
files: ./cover.txt
name: testcontainers-go-${{ matrix.go-version }}

- name: modTidy e2e tests
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: make -C e2e tools-tidy

- name: Run e2e tests
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: make test-e2e

- name: Run checker
run: |
./scripts/check_environment.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ site/
src/mkdocs-codeinclude-plugin
src/pip-delete-this-directory.txt
.idea/
.DS_Store

cover.txt
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

.PHONY: test-all
test-all: tools test-unit test-e2e

.PHONY: test-unit
test-unit:
@echo "Running unit tests..."
go run gotest.tools/gotestsum \
--format short-verbose \
--rerun-fails=5 \
--packages="./..." \
-- -coverprofile=cover.txt

.PHONY: test-e2e
test-e2e:
@echo "Running end-to-end tests..."
make -C e2e test

.PHONY: tools
tools:
go mod download
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ verify_ssl = true

[packages]
mkdocs = "*"
mkdocs-codeinclude-plugin = "*"
mkdocs-material = "*"
mkdocs-markdownextradata-plugin = "*"

Expand Down
Loading

0 comments on commit ec477cb

Please sign in to comment.