diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 67dbf834..7383f21e 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -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 + - 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. @@ -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: