Skip to content

Commit 8aef34d

Browse files
authored
(chore) Migrate from ADO -> GHA (#2961)
(chore) Migrate from ADO -> GHA Signed-off-by: Sarah Christoff <28318173+schristoff@users.noreply.github.com>
1 parent 4d2a6e5 commit 8aef34d

7 files changed

+335
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# Environment variables defined in a calling workflow are not accessible to this reusable workflow. Refer to the documentation for further details on this limitation.
2+
name: build_azure_pipelinesrelease_template
3+
on:
4+
workflow_call:
5+
inputs:
6+
goVersion:
7+
required: false
8+
default: 1.20.7
9+
type: string
10+
registry:
11+
required: false
12+
default: ghcr.io/getporter/test
13+
type: string
14+
shouldPublish:
15+
required: false
16+
default: false
17+
type: boolean
18+
skipTests:
19+
required: false
20+
default: false
21+
type: boolean
22+
jobs:
23+
Validate-build:
24+
name: Native Compile
25+
runs-on: "{{ vars.}}"
26+
steps:
27+
- name: checkout
28+
uses: actions/checkout@v4.1.0
29+
- uses: actions/setup-go@v4
30+
with:
31+
go-version: "${{ inputs.GOVERSION }}"
32+
- name: Configure Agent
33+
run: go run mage.go ConfigureAgent
34+
- name: Native Build
35+
run: mage build
36+
shell: bash
37+
- name: Publish Native Binaries
38+
uses: actions/upload-artifact@v4.0.0
39+
with:
40+
name: build-bin
41+
path: "${{ github.workspace }}/bin"
42+
Validate-xbuild:
43+
name: Cross Compile
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: checkout
47+
uses: actions/checkout@v4.1.0
48+
- uses: actions/setup-go@v4
49+
with:
50+
go-version: "${{ inputs.GOVERSION }}"
51+
- name: Configure Agent
52+
run: go run mage.go ConfigureAgent
53+
- name: Cross Compile
54+
run: mage XBuildAll
55+
shell: bash
56+
- name: Publish Release Binaries
57+
uses: actions/upload-artifact@v4.0.0
58+
with:
59+
name: xbuild-bin
60+
path: "${{ github.workspace }}/bin"
61+
Validate-VetLint:
62+
name: Vet and Lint
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: checkout
66+
uses: actions/checkout@v4.1.0
67+
- uses: actions/setup-go@v4
68+
with:
69+
go-version: "${{ inputs.GOVERSION }}"
70+
- name: Configure Agent
71+
run: go run mage.go ConfigureAgent
72+
- name: Vet
73+
run: mage Vet
74+
shell: bash
75+
- name: Lint
76+
run: mage Lint
77+
shell: bash
78+
Validate-unit_test:
79+
name: Unit Test
80+
runs-on: ubuntu-latest
81+
if: !(inputs.skipTests)
82+
steps:
83+
- name: checkout
84+
uses: actions/checkout@v4.1.0
85+
- uses: actions/setup-go@v4
86+
with:
87+
go-version: "${{ inputs.GOVERSION }}"
88+
- name: Configure Agent
89+
run: go run mage.go ConfigureAgent
90+
- name: Unit Test
91+
run: mage TestUnit
92+
shell: bash
93+
Validate-integration_test:
94+
env:
95+
GHCR_IOGETPORTER_DOCKER_REGISTRY: https://ghcr.io
96+
GHCR_IOGETPORTER_DOCKER_USERNAME: getporterbot
97+
name: Integration Test
98+
needs:
99+
- Validate-build
100+
runs-on: ubuntu-latest
101+
steps:
102+
- name: checkout
103+
uses: actions/checkout@v4.1.0
104+
- uses: actions/setup-go@v4
105+
with:
106+
go-version: "${{ inputs.GOVERSION }}"
107+
- name: Download Bin
108+
uses: actions/download-artifact@v4.1.0
109+
with:
110+
name: build-bin
111+
path: bin
112+
- name: Docker Login
113+
uses: docker/login-action@v3.0.0
114+
with:
115+
registry: "${{ env.GHCR_IOGETPORTER_DOCKER_REGISTRY }}"
116+
username: "${{ env.GHCR_IOGETPORTER_DOCKER_USERNAME }}"
117+
password: "${{ secrets.GHCR_IOGETPORTER_DOCKER_PASSWORD }}"
118+
- name: Configure Agent
119+
run: go run mage.go ConfigureAgent SetBinExecutable
120+
- name: Integration Test
121+
run: mage -v TestIntegration
122+
Validate-smoke_test:
123+
name: Run smoke tests on
124+
needs:
125+
- Validate-xbuild
126+
runs-on:
127+
- self-hosted
128+
if: success() && !(inputs.skipTests)
129+
steps:
130+
- name: checkout
131+
uses: actions/checkout@v4.1.0
132+
- uses: actions/setup-go@v4
133+
with:
134+
go-version: "${{ inputs.GOVERSION }}"
135+
- name: Download Cross-Compiled Porter Binaries
136+
uses: actions/download-artifact@v4.1.0
137+
with:
138+
name: xbuild-bin
139+
path: bin
140+
- name: Setup Bin
141+
run: go run mage.go ConfigureAgent UseXBuildBinaries
142+
- name: Run Smoke Tests
143+
run: mage -v TestSmoke
144+
Publish-publish_binaries:
145+
name: Publish Binaries
146+
needs:
147+
- Validate-build
148+
- Validate-xbuild
149+
- Validate-VetLint
150+
- Validate-unit_test
151+
- Validate-integration_test
152+
- Validate-smoke_test
153+
runs-on: ubuntu-latest
154+
if: success() && inputs.shouldPublish
155+
steps:
156+
- name: checkout
157+
uses: actions/checkout@v4.1.0
158+
- uses: actions/setup-go@v4
159+
with:
160+
go-version: "${{ inputs.GOVERSION }}"
161+
- name: Download Cross-Compiled Porter Binaries
162+
uses: actions/download-artifact@v4.1.0
163+
with:
164+
name: xbuild-bin
165+
path: bin
166+
- name: Setup Bin
167+
run: go run mage.go ConfigureAgent UseXBuildBinaries
168+
- name: Publish Porter Binaries
169+
env:
170+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
171+
run: mage PublishPorter PublishMixins
172+
Publish-publish_docker:
173+
env:
174+
DOCKER_REGISTRY:
175+
DOCKER_USERNAME:
176+
name: Publish Docker Images
177+
needs:
178+
- Validate-build
179+
- Validate-xbuild
180+
- Validate-VetLint
181+
- Validate-unit_test
182+
- Validate-integration_test
183+
- Validate-smoke_test
184+
runs-on: ubuntu-latest
185+
if: success() && inputs.shouldPublish
186+
steps:
187+
- name: checkout
188+
uses: actions/checkout@v4.1.0
189+
- uses: actions/setup-go@v4
190+
with:
191+
go-version: "${{ inputs.GOVERSION }}"
192+
- name: Download Cross-Compiled Porter Binaries
193+
uses: actions/download-artifact@v4.1.0
194+
with:
195+
name: xbuild-bin
196+
path: bin
197+
- name: Setup Bin
198+
run: go run mage.go ConfigureAgent UseXBuildBinaries
199+
# Unable to determine registry '${{parameters.registry}}' type. The service connection was not found or the authentication type not supported.
200+
- name: Docker Login
201+
uses: docker/login-action@v3.0.0
202+
with:
203+
registry: "${{ env.DOCKER_REGISTRY }}"
204+
username: "${{ env.DOCKER_USERNAME }}"
205+
password: "${{ secrets.DOCKER_PASSWORD }}"
206+
- name: Publish Docker Images to ${{inputs.registry}}
207+
run: PORTER_REGISTRY=${{inputs.registry}} mage PublishImages

.github/workflows/porter-canary.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: porter/porter-canary
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
shouldPublish:
6+
default: true
7+
type: boolean
8+
required: false
9+
skipTests:
10+
default: false
11+
type: boolean
12+
required: false
13+
push:
14+
branches:
15+
- main
16+
- release/*
17+
pull_request:
18+
branches:
19+
- split-builds
20+
jobs:
21+
build_azure_pipelinesrelease_template:
22+
name: build_azure_pipelinesrelease_template
23+
uses: "./.github/workflows/build_azure_pipelinesrelease_template.yml"
24+
with:
25+
registry: ghcr.io/getporter
26+
shouldPublish: "${{inputs.shouldPublish}}"
27+
skipTests: "${{inputs.skipTests}}"
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: porter/porter-install-check
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
jobs:
10+
linux:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: checkout
14+
uses: actions/checkout@v4.1.0
15+
- name: Test Install Script
16+
run: scripts/test/test-linux-install.sh
17+
shell: bash
18+
windows:
19+
runs-on: windows-latest
20+
steps:
21+
- name: checkout
22+
uses: actions/checkout@v4.1.0
23+
- name: Test Install Script
24+
run: scripts\test\test-windows-install.ps1
25+
shell: powershell
26+
macos:
27+
runs-on:
28+
- self-hosted
29+
- macOS-latest
30+
steps:
31+
- name: checkout
32+
uses: actions/checkout@v4.1.0
33+
- name: Test Install Script
34+
run: scripts/test/test-mac-install.sh
35+
shell: bash

.github/workflows/porter-integration.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: checkout
23-
uses: actions/checkout@v3.6.0
23+
uses: actions/checkout@v4.1.0
2424
- uses: actions/setup-go@v4
2525
with:
2626
go-version: "${{ env.GOVERSION }}"
27-
# Unable to determine registry 'ghcr.io/getporter' type. The service connection was not found or the authentication type not supported.
2827
- name: Docker Login
29-
uses: docker/login-action@v2.2.0
28+
uses: docker/login-action@v3.0.0
3029
with:
3130
registry: ghcr.io
3231
username: ${{ github.actor }}

.github/workflows/porter-release.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: porter/porter-release
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
- "!latest*"
7+
- "!canary*"
8+
jobs:
9+
build_azure_pipelinesrelease_template:
10+
name: build_azure_pipelinesrelease_template
11+
uses: "./.github/workflows/build_azure_pipelinesrelease_template.yml"
12+
with:
13+
registry: ghcr.io/getporter
14+
shouldPublish: true
15+
skipTests: true
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: porter/test-porter-release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
shouldPublish:
6+
default: true
7+
type: boolean
8+
required: false
9+
skipTests:
10+
default: true
11+
type: boolean
12+
required: false
13+
pull_request:
14+
branches:
15+
- main
16+
env:
17+
PORTER_PACKAGES_REMOTE: https://github.com/carolynvs/porter-packages.git
18+
PORTER_RELEASE_REPOSITORY: github.com/carolynvs/porter
19+
jobs:
20+
build_azure_pipelinesrelease_template:
21+
name: build_azure_pipelinesrelease_template
22+
uses: "./.github/workflows/build_azure_pipelinesrelease_template.yml"
23+
with:
24+
registry: ghcr.io/getporter/test
25+
shouldPublish: "${{ inputs.shouldPublish }}"
26+
skipTests: "${{ inputs.skipTests }}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: porter/testporterbot.porter-release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
shouldPublish:
6+
default: true
7+
type: boolean
8+
required: false
9+
skipTests:
10+
default: true
11+
type: boolean
12+
required: false
13+
pull_request:
14+
branches:
15+
- release/v1
16+
jobs:
17+
build_azure_pipelinesrelease_template:
18+
name: build_azure_pipelinesrelease_template
19+
uses: "./.github/workflows/build_azure_pipelinesrelease_template.yml"
20+
with:
21+
registry: ghcr.io/getporter/test
22+
shouldPublish: "${{ inputs.shouldPublish }}"
23+
skipTests: "${{ inputs.skipTests }}"

0 commit comments

Comments
 (0)