-
Notifications
You must be signed in to change notification settings - Fork 278
Expand file tree
/
Copy pathcontainerization-build-template.yml
More file actions
116 lines (113 loc) · 3.65 KB
/
containerization-build-template.yml
File metadata and controls
116 lines (113 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build containerization template
on:
workflow_call:
inputs:
release:
type: boolean
description: "Create a release"
default: false
version:
type: string
description: Version of containerization
default: test
jobs:
buildAndTest:
name: Build and Test repo
timeout-minutes: 90
runs-on: [self-hosted, macos, sequoia, ARM64]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Activate Swiftly
run: |
source /opt/swiftly/env.sh
cat /opt/swiftly/env.sh
- name: Check formatting
run: |
./scripts/install-hawkeye.sh
make fmt
git diff
if ! git diff --quiet ; then echo the following files require formatting or license headers: ; git diff --name-only ; false ; fi
env:
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
- name: Check protobufs
run: |
make protos
if ! git diff --quiet ; then echo the following files require formatting or license headers: ; git diff --name-only ; false ; fi
env:
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
CURRENT_SDK: y
- name: Make containerization and docs
run: |
make clean containerization docs
tar cfz _site.tgz _site
env:
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
CURRENT_SDK: y
- name: Make vminitd image
run: |
source /opt/swiftly/env.sh
make -C vminitd linux-sdk
make init
env:
CURRENT_SDK: y
- name: Test containerization
run: |
make fetch-default-kernel
make test integration
env:
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY_USERNAME: ${{ github.actor }}
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
CURRENT_SDK: y
- name: Push vminitd image
if: ${{ inputs.release }}
run: |
bin/cctl images tag vminit:latest ghcr.io/apple/containerization/vminit:${{ inputs.version }}
bin/cctl images push ghcr.io/apple/containerization/vminit:${{ inputs.version }}
env:
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY_USERNAME: ${{ github.actor }}
REGISTRY_HOST: ghcr.io
- name: Create image tar
if: ${{ inputs.release }} != true
run: |
bin/cctl images save vminit:latest -o vminit.tar
- name: Save vminit artifact
if: ${{ inputs.release }} != true
uses: actions/upload-artifact@v4
with:
name: vminit
path: vminit.tar
- name: Save documentation artifact
uses: actions/upload-artifact@v4
with:
name: api-docs
path: "./_site.tgz"
retention-days: 14
uploadPages:
# Separate upload step required because upload-pages-artifact needs
# gtar which is not on the macOS runner.
name: Upload artifact for GitHub Pages
needs: buildAndTest
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: api-docs
- name: Add API docs to documentation
run: |
tar xfz _site.tgz
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./_site"