mirror of
https://github.com/docker/compose.git
synced 2025-07-02 03:14:26 +02:00
Add GitHub Action workflow to run tests on Mac/Windows runners
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
parent
723078c593
commit
937fa2dc8f
82
.github/workflows/merge.yml
vendored
Normal file
82
.github/workflows/merge.yml
vendored
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
name: merge
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'v2'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
e2e:
|
||||||
|
name: Build and test
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 15
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [desktop-windows, desktop-macos, desktop-m1]
|
||||||
|
# mode: [plugin, standalone]
|
||||||
|
mode: [plugin]
|
||||||
|
env:
|
||||||
|
GO111MODULE: "on"
|
||||||
|
steps:
|
||||||
|
- name: test-action-unsafe-checkout
|
||||||
|
if: ${{ contains(matrix.os, 'desktop-windows') }}
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory C:/actions-runner/_work/compose/compose
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# TODO(milas): revert to @v3 after next actions/setup-go minor release
|
||||||
|
- uses: actions/setup-go@f27981397569ab1d623dab1f29d3db81b75b5258
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
cache: true
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Check arch of go binary
|
||||||
|
run: |
|
||||||
|
which go
|
||||||
|
file $(which go)
|
||||||
|
if: ${{ !contains(matrix.os, 'desktop-windows') }}
|
||||||
|
|
||||||
|
- name: List Docker resources on machine
|
||||||
|
run: |
|
||||||
|
docker ps --all
|
||||||
|
docker volume ls
|
||||||
|
docker network ls
|
||||||
|
docker image ls
|
||||||
|
- name: Remove Docker resources on machine
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
docker kill $(docker ps -q)
|
||||||
|
docker rm -f $(docker ps -aq)
|
||||||
|
docker volume rm -f $(docker volume ls -q)
|
||||||
|
docker ps --all
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
- name: Build binaries
|
||||||
|
run: |
|
||||||
|
make
|
||||||
|
- name: Check arch of go compose binary
|
||||||
|
run: |
|
||||||
|
file ./bin/build/docker-compose
|
||||||
|
if: ${{ !contains(matrix.os, 'desktop-windows') }}
|
||||||
|
-
|
||||||
|
name: Test plugin mode
|
||||||
|
if: ${{ matrix.mode == 'plugin' }}
|
||||||
|
run: |
|
||||||
|
make e2e-compose
|
||||||
|
-
|
||||||
|
name: Test standalone mode
|
||||||
|
if: ${{ matrix.mode == 'standalone' }}
|
||||||
|
run: |
|
||||||
|
make e2e-compose-standalone
|
||||||
|
|
@ -60,7 +60,7 @@ func (l *lockedBuffer) RequireEventuallyContains(t testing.TB, v string) {
|
|||||||
"Error: %v", err)
|
"Error: %v", err)
|
||||||
}
|
}
|
||||||
return strings.Contains(bufContents.String(), v)
|
return strings.Contains(bufContents.String(), v)
|
||||||
}, 2*time.Second, 20*time.Millisecond,
|
}, 5*time.Second, 20*time.Millisecond,
|
||||||
"Buffer did not contain %q\n============\n%s\n============",
|
"Buffer did not contain %q\n============\n%s\n============",
|
||||||
v, &bufContents)
|
v, &bufContents)
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ func TestPauseServiceAlreadyPaused(t *testing.T) {
|
|||||||
|
|
||||||
// launch a and wait for it to come up
|
// launch a and wait for it to come up
|
||||||
cli.RunDockerComposeCmd(t, "up", "-d", "a")
|
cli.RunDockerComposeCmd(t, "up", "-d", "a")
|
||||||
HTTPGetWithRetry(t, urlForService(t, cli, "a", 80), http.StatusOK, 50*time.Millisecond, 5*time.Second)
|
HTTPGetWithRetry(t, urlForService(t, cli, "a", 80), http.StatusOK, 50*time.Millisecond, 10*time.Second)
|
||||||
|
|
||||||
// pause a twice - first time should pass, second time fail
|
// pause a twice - first time should pass, second time fail
|
||||||
cli.RunDockerComposeCmd(t, "pause", "a")
|
cli.RunDockerComposeCmd(t, "pause", "a")
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
//go:build !windows
|
||||||
|
// +build !windows
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2022 Docker Compose CLI authors
|
Copyright 2022 Docker Compose CLI authors
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user