Skip to content

Commit

Permalink
Add Podman pipeline
Browse files Browse the repository at this point in the history
Failures during test execution are ignored for now. Passing all tests can be achieved over time.
  • Loading branch information
prskr committed May 31, 2022
1 parent a4236d9 commit c212f28
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 6 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci-podman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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-latest
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: modVerify
run: go mod verify

- name: modTidy
run: go mod tidy

- name: ensure compilation
env:
GOOS: linux
run: go build

- 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 ||:
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$( lsb_release -rs )/Release.key | sudo apt-key add -
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$( lsb_release -rs )/ /" | sudo tee /etc/apt/sources.list.d/podman.list /dev/null
sudo apt-get update
sudo apt-get install -y podman
sudo systemctl start podman
systemctl --user enable --now podman.socket
systemctl --user status podman.socket
podman info
- name: Set DOCKER_HOST
run: echo "DOCKER_HOST=unix:///$XDG_RUNTIME_DIR/podman/podman.sock" >> $GITHUB_ENV

- 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: go run gotest.tools/gotestsum --format short-verbose -- -coverprofile=cover.txt ./...
continue-on-error: true

# only report code coverage on linux
- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
files: ./cover.txt
name: testcontainers-podman-go-${{ matrix.go-version }}
12 changes: 6 additions & 6 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 @@ -24,13 +24,13 @@ jobs:
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
uses: actions/checkout@v3

- name: modVerify
run: go mod verify
Expand All @@ -57,7 +57,7 @@ jobs:
# 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 }}

0 comments on commit c212f28

Please sign in to comment.