github.com/KEINOS/go-countline@v1.1.0/.github/docker-compose.yml (about)

     1  # =============================================================================
     2  # Docker Compose file for testing on Go versions 1.16 to the latest.
     3  # =============================================================================
     4  # It is recommended to run specifying a specific Go version and not at once.
     5  #
     6  # Since the service `tidy` will update/re-write the "go.mod" file to the latest
     7  # version, during it's process the "go.mod" file will be gone temporarily. Thus,
     8  # it will cause failure in the other container because of missing "go.mod" file.
     9  #
    10  # - Recommended usage:
    11  #     $ docker-compose --file ./.github/docker-compose.yml run v1_16
    12  # - To update go.mod:
    13  #     $ docker-compose --file ./.github/docker-compose.yml run tidy
    14  # - **NOT** recommended to run all tests at once whith "up":
    15  #     $ docker-compose --file ./.github/docker-compose.yml up
    16  version: "3"
    17  
    18  volumes:
    19    GO_PKG_MOD:
    20    TEST_DATA:
    21  
    22  services:
    23    # Service tidy updates the go.mod to the latest
    24    tidy:
    25      build:
    26        context: ..
    27        dockerfile: ./.github/Dockerfile
    28        args:
    29          VARIANT: 1.16-alpine
    30      volumes:
    31        - ..:/workspaces
    32        - TEST_DATA:/workspaces/cl/testdata
    33      entrypoint: [ "./.github/run_go_mod_tidy.sh" ]
    34    # Service v1_16 runs the tests on Go v1.16
    35    v1_16:
    36      build:
    37        context: ..
    38        dockerfile: ./.github/Dockerfile
    39        args:
    40          VARIANT: 1.16-alpine
    41      volumes:
    42        - ..:/workspaces
    43        - GO_PKG_MOD:/go/pkg/mod
    44        - TEST_DATA:/workspaces/cl/testdata
    45    # Service v1_17 runs the tests on Go v1.17
    46    v1_17:
    47      build:
    48        context: ..
    49        dockerfile: ./.github/Dockerfile
    50        args:
    51          VARIANT: 1.17-alpine
    52      volumes:
    53        - ..:/workspaces
    54        - GO_PKG_MOD:/go/pkg/mod
    55        - TEST_DATA:/workspaces/cl/testdata
    56    # Service v1_18 runs the tests on Go v1.18
    57    v1_18:
    58      build:
    59        context: ..
    60        dockerfile: ./.github/Dockerfile
    61        args:
    62          VARIANT: 1.18-alpine
    63      volumes:
    64        - ..:/workspaces
    65        - GO_PKG_MOD:/go/pkg/mod
    66        - TEST_DATA:/workspaces/cl/testdata
    67    # Service v1_19 runs the tests on Go v1.19
    68    v1_19:
    69      build:
    70        context: ..
    71        dockerfile: ./.github/Dockerfile
    72        args:
    73          VARIANT: 1.19-alpine
    74      volumes:
    75        - ..:/workspaces
    76        - GO_PKG_MOD:/go/pkg/mod
    77        - TEST_DATA:/workspaces/cl/testdata
    78    # Service latest runs the tests on latest Go docker image
    79    latest:
    80      build:
    81        context: ..
    82        dockerfile: ./.github/Dockerfile
    83        args:
    84          VARIANT: alpine
    85      volumes:
    86        - ..:/workspaces
    87        - GO_PKG_MOD:/go/pkg/mod
    88        - TEST_DATA:/workspaces/cl/testdata