Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,64 +16,79 @@ jobs:
permissions:
contents: read
packages: read
env:
CURRENT_SDK: y
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Update containerization
run: |
/usr/bin/swift package update containerization

- name: Check formatting
run: |
./scripts/install-hawkeye.sh
make fmt
if ! git diff --quiet -- . ':(exclude)Package.swift' ':(exclude)Package.resolved'; then echo "The following files require formatting or license header updates:\n$(git diff --name-only)" ; false ; fi

if ! git diff --quiet -- . ; then
echo "❌ The following files require formatting or license header updates:"
git diff --name-only -- .
false
fi

- name: Check protobuf
run: |
make protos

# TODO [launch]: TEMPORARILY we need to exclude these files since we had to modify them to add
# the github token for pulling the private repos.
if ! git diff --quiet -- . ':(exclude)Package.swift' ':(exclude)Package.resolved' ':(exclude)Protobuf.Makefile'; then echo "The following files require formatting or license header updates:\n$(git diff --name-only)" ; false ; fi
env:
CURRENT_SDK: y
if ! git diff --quiet -- . ; then
echo "❌ The following files require formatting or license header updates:"
git diff --name-only -- .
false
fi

- name: Set build configuration
run: |
echo "BUILD_CONFIGURATION=debug" >> $GITHUB_ENV
if [ ${{ inputs.release }} == true ]; then
if [[ "${{ inputs.release }}" == "true" ]]; then
echo "BUILD_CONFIGURATION=release" >> $GITHUB_ENV
fi

- name: Make the container project and docs
run: |
make container dsym docs
tar cfz _site.tgz _site
env:
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
CURRENT_SDK: y

- name: Create package
run: |
mkdir -p outputs
mv bin/${{ env.BUILD_CONFIGURATION }}/container-installer-unsigned.pkg outputs
mv bin/${{ env.BUILD_CONFIGURATION }}/bundle/container-dSYM.zip outputs

- name: Test the container project
run: |
launchctl setenv HTTP_PROXY $HTTP_PROXY
make test cleancontent install-kernel integration
env:
DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer"
CURRENT_SDK: y
CURRENT_SDK: y # explicitly repeated due to local env block
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katiewasnothere Do we still need CURRENT_SDK?


- name: Save documentation artifact
uses: actions/upload-artifact@v4
with:
name: api-docs
path: "./_site.tgz"
retention-days: 14

- name: Save package artifacts
uses: actions/upload-artifact@v4
with:
name: container-package
path: ${{ github.workspace }}/outputs

uploadPages:
# Separate upload step required because upload-pages-artifact needs
# gtar which is not on the macOS runner.
Expand All @@ -84,13 +99,16 @@ jobs:
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:
Expand Down