Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
publish cross platform artifacts for PRs
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Aug 25, 2021
1 parent 51a6c95 commit b2cc2ff
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 29 deletions.
72 changes: 43 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,6 @@ jobs:
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 cross-compose-plugin

build:
name: Build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -101,5 +74,46 @@ jobs:
BUILD_TAGS: e2e
run: make -f builder.Makefile cli compose-plugin

- name: E2E Test
run: make e2e-compose
# - name: E2E Test
# run: make e2e-compose

# Publish test-binaries for PRs and Ensure we don't discover cross-platform build issues at release time.
- name: Build cross platform compose-plugin binaries
run: make -f builder.Makefile cross-compose-plugin

- name: Upload macos-amd64 binary
uses: actions/upload-artifact@v2
if: github.event_name == 'pull_request'
with:
name: docker-compose-darwin-amd64
path: ${{ github.workspace }}/bin/docker-compose-darwin-amd64

- name: Upload macos-arm64 binary
uses: actions/upload-artifact@v2
if: github.event_name == 'pull_request'
with:
name: docker-compose-darwin-arm64
path: ${{ github.workspace }}/bin/docker-compose-darwin-arm64

- name: Upload linux-amd64 binary
uses: actions/upload-artifact@v2
if: github.event_name == 'pull_request'
with:
name: docker-compose-linux-amd64
path: ${{ github.workspace }}/bin/docker-compose-linux-amd64

- name: Upload windows-amd64 binary
uses: actions/upload-artifact@v2
if: github.event_name == 'pull_request'
with:
name: docker-windows-linux-amd64.exe
path: ${{ github.workspace }}/bin/docker-compose-windows-amd64.exe

- name: artifact links
uses: tonyhallett/artifacts-url-comments@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prefix: Test this PR using built artifacts
format: name
addTo: pull
13 changes: 13 additions & 0 deletions .github/workflows/pr-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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

0 comments on commit b2cc2ff

Please sign in to comment.