-
Notifications
You must be signed in to change notification settings - Fork 0
Sync with remote repo #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d58bc65
956f215
445b8d7
8ff08cd
8561d52
5e5025a
186b59c
7ae5be9
0c04fbb
2f8b0bd
8bc23cb
7e01b2e
8caf637
b5f9657
e6a5884
89c72b0
7205434
0628e5d
42ed974
7663ea5
f0a5430
f182fbe
09a44c3
74863c9
32cb84f
df647d2
65d59a7
15a21bb
310103f
a230219
30f7c2e
71cb4a6
fa747b2
ee12def
d9088dc
ec3c14c
2c2b269
0b53fc3
e38397e
494cf33
485ca7e
8ef0378
5ef671a
d479a39
56a636c
6b25fdf
bd13bed
9b35a21
384b240
ca6928e
0d57ab9
5b1ae4a
398f730
15d8517
d482e74
7ee0a6d
315cdab
b59f20a
a0d9c57
78df37c
edd39be
5315f7b
d820e8f
67534d0
52e9b39
23c9a6d
2dfcda9
c5c3b86
67c2e3a
f3bbf11
3fefccd
8329446
f1772ed
0559928
89c69b5
aa52c9a
1811db6
721928a
acfab42
1dada7b
db9f3ef
8847989
36bcdd9
9f83379
928193e
12abda3
98dc72c
8d34a72
02a5166
e99a51c
3f301a2
845aaeb
e08a465
a93d2ea
a4961db
ee6a00c
f64d51c
27a5bc2
723fbf3
8bcfdf7
094542d
3535ea7
67b5363
544b4e8
10a61ba
22baab0
6390723
b53c21b
9be678e
a899130
7da37d2
f9b03f4
f0dd5e9
25a1ba1
0a2039e
efed4a3
116c15a
69c4a20
749a68b
515f8c7
3de8b0d
4e6c161
ace7b51
ff12e2c
7584f97
0f5b879
c07e24d
7555323
4c3bc81
daf6257
3fb923c
4207d39
57c0f49
a1790fc
1ff28bf
6751158
00137be
a0bc5fd
471c47b
bcf7ca8
89d74d6
4788196
39af0cf
2329e96
81ba5f8
2ecef19
9f60448
cc9c1ae
e72b2ea
d613141
adb2c15
6743c9d
e4450f9
3f646ba
d1fc782
447a899
70abeb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,15 @@ | ||
| name: "CodeQL" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| schedule: | ||
| - cron: '34 5 * * *' # daily at 5:34am UTC | ||
| - cron: '34 5 * * *' # daily at 5:34am UTC | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
|
|
@@ -21,15 +19,15 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
| uses: actions/checkout@v5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v2 | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
|
|
||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v2 | ||
| uses: github/codeql-action/autobuild@v4 | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v2 | ||
| uses: github/codeql-action/analyze@v4 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| name: 'Compile Dependency on Target - Reusable Workflow' | ||
|
|
||
| description: | | ||
| Compiles Dependency on given target, os, and arch | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| description: 'dependency version' | ||
| required: true | ||
| type: string | ||
| target: | ||
| description: 'dependency OS target variant' | ||
| required: true | ||
| type: string | ||
| os: | ||
| description: 'platform OS (e.g., linux)' | ||
| required: true | ||
| type: string | ||
| arch: | ||
| description: 'platform architecture (e.g., amd64)' | ||
| required: true | ||
| type: string | ||
| shouldCompile: | ||
| description: 'whether to compile the dependency' | ||
| required: true | ||
| type: boolean | ||
| shouldTest: | ||
| description: 'whether to test the dependency after compilation' | ||
| required: true | ||
| type: boolean | ||
| uploadArtifactName: | ||
| description: 'name of the artifact to upload' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| compile: | ||
| # Speed up compilation by using runners that match os and arch when they are set, otherwise fall back to emulation. | ||
| runs-on: ${{ (inputs.os == 'linux' && inputs.arch == 'arm64') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| - name: Enable experimental features for Docker daemon and CLI | ||
| run: | | ||
| echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json | ||
| sudo systemctl restart docker | ||
| mkdir -p ~/.docker | ||
| echo '{"experimental": "enabled"}' | sudo tee ~/.docker/config.json | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Setup before compilation | ||
| id: compile-setup | ||
| run: | | ||
| echo "outputdir=$(mktemp -d)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: docker build | ||
| id: docker-build | ||
| env: | ||
| SKIP_LOGIN: true | ||
| if: ${{ inputs.shouldCompile == true || inputs.shouldCompile == 'true' }} | ||
| uses: actions-hub/docker/cli@master | ||
| with: | ||
| args: "build ${{ (inputs.os != '' && inputs.arch != '') && format('--platform {0}/{1}', inputs.os, inputs.arch) || '' }} -t compilation -f dependency/actions/compile/${{ inputs.target }}.Dockerfile dependency/actions/compile" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
|
|
||
| - name: docker run | ||
| id: docker-run | ||
| uses: actions-hub/docker/cli@master | ||
| env: | ||
| SKIP_LOGIN: true | ||
| if: ${{ inputs.shouldCompile == true || inputs.shouldCompile == 'true' }} | ||
| with: | ||
| args: "run ${{ (inputs.os != '' && inputs.arch != '') && format('--platform {0}/{1}', inputs.os, inputs.arch) || '' }} -v ${{ steps.compile-setup.outputs.outputdir }}:/home compilation --outputDir /home --target ${{ inputs.target }} --version ${{ inputs.version }} ${{ inputs.os != '' && format('--os {0}', inputs.os) || '' }} ${{ inputs.arch != '' && format('--arch {0}', inputs.arch) || '' }}" | ||
|
|
||
| - name: Print contents of output dir | ||
| shell: bash | ||
| run: ls -lah ${{ steps.compile-setup.outputs.outputdir }} | ||
|
|
||
| - name: Test Dependency | ||
| working-directory: dependency | ||
| if: ${{ (inputs.shouldCompile == true || inputs.shouldCompile == 'true') && (inputs.shouldTest == true || inputs.shouldTest == 'true') }} | ||
| run: | | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| shopt -s inherit_errexit | ||
|
|
||
| make test \ | ||
| version="${{ inputs.version }}" \ | ||
| tarballPath="${{ steps.compile-setup.outputs.outputdir }}/*.tgz" \ | ||
| os="${{ inputs.os }}" \ | ||
| arch="${{ inputs.arch }}" | ||
|
|
||
| - name: Upload compiled artifact | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ inputs.shouldCompile == true || inputs.shouldCompile == 'true' }} | ||
| with: | ||
| name: '${{ inputs.uploadArtifactName }}' | ||
| path: '${{ steps.compile-setup.outputs.outputdir }}/*' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,16 +17,16 @@ concurrency: release | |
| jobs: | ||
| unit: | ||
| name: Unit Tests | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: ubuntu-24.04 | ||
| outputs: | ||
| builders: ${{ steps.builders.outputs.builders }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v3 | ||
| uses: actions/setup-go@v6 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| with: | ||
| go-version: 'stable' | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| go-version-file: go.mod | ||
| - name: Run Unit Tests | ||
| run: ./scripts/unit.sh | ||
| - name: Get builders from integration.json | ||
|
|
@@ -39,39 +39,45 @@ jobs: | |
|
|
||
| integration: | ||
| name: Integration Tests | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: ubuntu-24.04 | ||
| needs: unit | ||
| strategy: | ||
| matrix: | ||
| builder: ${{ fromJSON(needs.unit.outputs.builders) }} | ||
| fail-fast: false # don't cancel all test jobs when one fails | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v3 | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: 'stable' | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| go-version-file: go.mod | ||
| - name: Run Integration Tests | ||
| run: ./scripts/integration.sh --builder ${{ matrix.builder }} --token ${{ github.token }} | ||
| env: | ||
| TMPDIR: "${{ runner.temp }}" | ||
|
|
||
| release: | ||
| name: Release | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: ubuntu-24.04 | ||
| needs: integration | ||
| steps: | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v3 | ||
| with: | ||
| go-version: 'stable' | ||
| services: | ||
| registry: | ||
| image: registry:3 | ||
| ports: | ||
| - 5000:5000 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-tags: true | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Reset Draft Release | ||
| id: reset | ||
| uses: paketo-buildpacks/github-config/actions/release/reset-draft@main | ||
|
|
@@ -110,13 +116,86 @@ jobs: | |
| echo "buildpack_type=buildpack" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Get buildpack path | ||
| id: get_buildpack_path | ||
| run: | | ||
|
|
||
| if [ -f "build/buildpackage.cnb" ]; then | ||
| echo "path=build/buildpackage.cnb" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "path=build/buildpackage-linux-amd64.cnb" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Create Release Notes | ||
| id: create-release-notes | ||
| uses: paketo-buildpacks/github-config/actions/release/notes@main | ||
| with: | ||
| repo: ${{ github.repository }} | ||
| token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} | ||
| buildpack_type: ${{ steps.get_buildpack_type.outputs.buildpack_type }} | ||
| buildpackage_path: ${{ steps.get_buildpack_path.outputs.path }} | ||
|
|
||
| - name: Get Image Digest | ||
| id: image_digest | ||
| run: | | ||
| image_name="localhost:5000/npm-install:latest" | ||
|
|
||
| ./scripts/publish.sh \ | ||
| --buildpack-type ${{ steps.get_buildpack_type.outputs.buildpack_type }} \ | ||
| --image-ref $image_name | ||
|
|
||
| echo "digest=$(sudo skopeo inspect "docker://${image_name}" --tls-verify=false | jq -r .Digest)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Set Correct Image Digest on the Release notes | ||
| run: | | ||
| printf '${{ steps.create-release-notes.outputs.release_body }}' \ | ||
| | sed -E \ | ||
| "s/\*\*Digest:\*\* \`sha256:[a-f0-9]{64}\`/\*\*Digest:\*\* \`${{ steps.image_digest.outputs.digest }}\`/" \ | ||
| > ./release_notes | ||
|
|
||
| printf '${{ steps.image_digest.outputs.digest }}' > ./index-digest.sha256 | ||
|
|
||
| - name: Create release assets | ||
| id: create_release_assets | ||
| run: | | ||
| release_assets=$(jq -n --arg repo_name "${{ github.event.repository.name }}" --arg tag "${{ steps.tag.outputs.tag }}" ' | ||
| [ | ||
| { | ||
| "path": "build/buildpack.tgz", | ||
| "name": ($repo_name + "-" + $tag + ".tgz"), | ||
| "content_type": "application/gzip" | ||
| }, | ||
| { | ||
| "path": "./index-digest.sha256", | ||
| "name": ($repo_name + "-" + $tag + "-" + "index-digest.sha256"), | ||
| "content_type": "text/plain" | ||
| } | ||
| ]') | ||
|
|
||
| for filepath in build/*.cnb; do | ||
| filename=$(basename "$filepath") | ||
| asset_name="" | ||
| if [[ "$filename" == "buildpackage-linux-amd64.cnb" ]]; then | ||
| asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb" | ||
| elif [[ "$filename" == "buildpackage.cnb" ]]; then | ||
| asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb" | ||
| else | ||
| formatted_filename="${filename#buildpackage-}" | ||
| asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}-${formatted_filename}" | ||
| fi | ||
|
|
||
| release_assets=$(echo "$release_assets" | jq --arg asset_name "${asset_name}" --arg filepath "$filepath" ' | ||
| . + [ | ||
| { | ||
| "path": $filepath, | ||
| "name": $asset_name, | ||
| "content_type": "application/gzip" | ||
| } | ||
| ]') | ||
| done | ||
|
|
||
| release_assets=$(jq -c <<< "$release_assets" ) | ||
| printf "release_assets=%s\n" "${release_assets}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Create Release | ||
| uses: paketo-buildpacks/github-config/actions/release/create@main | ||
|
|
@@ -126,25 +205,13 @@ jobs: | |
| tag_name: v${{ steps.tag.outputs.tag }} | ||
| target_commitish: ${{ github.sha }} | ||
| name: v${{ steps.tag.outputs.tag }} | ||
| body: ${{ steps.create-release-notes.outputs.release_body }} | ||
| body_filepath: "./release_notes" | ||
| draft: true | ||
| assets: | | ||
| [ | ||
| { | ||
| "path": "build/buildpack.tgz", | ||
| "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.tgz", | ||
| "content_type": "application/gzip" | ||
| }, | ||
| { | ||
| "path": "build/buildpackage.cnb", | ||
| "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb", | ||
| "content_type": "application/gzip" | ||
| } | ||
| ] | ||
| assets: ${{ steps.create_release_assets.outputs.release_assets }} | ||
|
|
||
| failure: | ||
| name: Alert on Failure | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: ubuntu-24.04 | ||
| needs: [ unit, integration, release ] | ||
| if: ${{ always() && needs.unit.result == 'failure' || needs.integration.result == 'failure' || needs.release.result == 'failure' }} | ||
| steps: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/checkout@v5does not exist yet. The latest stable version is typicallyv4. Please verify the version tag.