diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dde09b653..924644eef 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -25,11 +25,13 @@ Welcome to the docker-compose issue tracker! Before creating an issue, please he ## Context information (for bug reports) -**Output of `docker-compose version`** +- [ ] Using Compose V2 `docker compose ...` +- [ ] Using Compose V1 `docker-compose ...` + +**Output of `docker(-)compose version`** ``` (paste here) ``` -/!\ If `docker-compose version` reports v2.0...` you're using the wrong repository, please report issues on [Compose-CLI](https://github.com/docker/compose-cli/issues/new) **Output of `docker version`** ``` diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml new file mode 100644 index 000000000..c0fe29ffc --- /dev/null +++ b/.github/workflows/artifacts.yml @@ -0,0 +1,58 @@ +name: Publish Artifacts +on: + issue_comment: + types: [created] +jobs: + publish-artifacts: + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/generate-artifacts') + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + id: go + + - name: Checkout code into the Go module directory + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: go-${{ hashFiles('**/go.sum') }} + + - name: Build cross platform compose-plugin binaries + run: make -f builder.Makefile cross + + - name: Upload macos-amd64 binary + uses: actions/upload-artifact@v2 + with: + name: docker-compose-darwin-amd64 + path: ${{ github.workspace }}/bin/docker-compose-darwin-amd64 + + - name: Upload macos-arm64 binary + uses: actions/upload-artifact@v2 + with: + name: docker-compose-darwin-arm64 + path: ${{ github.workspace }}/bin/docker-compose-darwin-arm64 + + - name: Upload linux-amd64 binary + uses: actions/upload-artifact@v2 + with: + name: docker-compose-linux-amd64 + path: ${{ github.workspace }}/bin/docker-compose-linux-amd64 + + - name: Upload windows-amd64 binary + uses: actions/upload-artifact@v2 + with: + name: docker-compose-windows-amd64.exe + path: ${{ github.workspace }}/bin/docker-compose-windows-amd64.exe + + - name: Update comment + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ github.event.comment.id }} + body: | + This PR can be tested using [binaries](https://github.com/docker/compose-cli/actions/runs/${{ github.run_id }}). + reactions: eyes + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..ada2146aa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,102 @@ +name: Continuous integration + +on: + push: + branches: + - v2 + pull_request: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + env: + GO111MODULE: "on" + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + id: go + + - name: Checkout code into the Go module directory + uses: actions/checkout@v2 + + - name: Validate go-mod is up-to-date and license headers + run: make validate + + - name: Run golangci-lint + env: + BUILD_TAGS: e2e + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.39.0 + make -f builder.Makefile lint + + # only on main branch, costs too much for the gain on every PR + validate-cross-build: + name: Validate cross build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + env: + GO111MODULE: "on" + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + id: go + + - name: Checkout code into the Go module directory + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: go-${{ hashFiles('**/go.sum') }} + + # Ensure we don't discover cross platform build issues at release time. + # Time used to build linux here is gained back in the build for local E2E step + - name: Build packages + run: make -f builder.Makefile cross + + build: + name: Build + runs-on: ubuntu-latest + env: + GO111MODULE: "on" + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + id: go + + - name: Set up gosum + run: | + go get -u gotest.tools/gotestsum + + - name: Setup docker CLI + run: | + curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz + sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version + + - name: Checkout code into the Go module directory + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: go-${{ hashFiles('**/go.sum') }} + + - name: Test + env: + BUILD_TAGS: kube + run: make -f builder.Makefile test + + - name: Build for local E2E + env: + BUILD_TAGS: e2e + run: make -f builder.Makefile compose-plugin + + - name: E2E Test + run: make e2e-compose diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml new file mode 100644 index 000000000..ab13ae126 --- /dev/null +++ b/.github/workflows/pr-closed.yml @@ -0,0 +1,11 @@ +name: PR cleanup +on: + pull_request: + types: [closed] +jobs: + delete_pr_artifacts: + runs-on: ubuntu-latest + steps: + - uses: stefanluptak/delete-old-pr-artifacts@v1 + with: + workflow_filename: ci.yaml \ No newline at end of file diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml new file mode 100644 index 000000000..db5203798 --- /dev/null +++ b/.github/workflows/rebase.yml @@ -0,0 +1,19 @@ +name: Automatic Rebase +on: + issue_comment: + types: [created] +jobs: + rebase: + name: Rebase + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') + runs-on: ubuntu-latest + steps: + - name: Checkout the latest code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + - name: Automatic Rebase + uses: cirrus-actions/rebase@1.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..e393a3051 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,42 @@ +name: Releaser + +on: + push: + tags: + - "v2*" +jobs: + upload-release: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + id: go + + - name: Setup docker CLI + run: | + curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz + sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version + + - name: Checkout code into the Go module directory + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Build + run: make -f builder.Makefile cross-compose-plugin + + - name: License + run: cp packaging/* bin/ + + - uses: ncipollo/release-action@v1 + with: + artifacts: "bin/*" + prerelease: true + token: ${{ secrets.GITHUB_TOKEN }}