forked from machulav/ec2-github-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/al2023 support #28
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
Draft
dm1tr1yvovk
wants to merge
26
commits into
main
Choose a base branch
from
feat/al2023-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d6fa056
feat: update action runner to the latest version and install libicu f…
dd84615
feat: trigger ci on any branch
6b4f7b9
feat: update self-hosted agent fromm AL2 to AL2023
948f8c9
feat: update self-hosted agent fromm AL2 to AL2023
6654a7e
feat: update self-hosted agent fromm AL2 to AL2023
1c8b278
feat: bump actions/runner to v2.333.1 for node24 support
kurok 6e6cabe
ci: verify dist is in sync with src and verify pinned runner URL
kurok 2689526
ci: bump deprecated actions/checkout and actions/cache to v4 in lint-…
kurok a6a82df
Merge pull request #3 from namecheap/feat/bump-runner-2.333.1
kurok 9f5ebfe
feat: declare action runtime as node24
kurok afb0195
Merge pull request #4 from namecheap/feat/action-runs-on-node24
kurok 36d00ed
fix: write outputs to GITHUB_OUTPUT file instead of ::set-output
kurok 945b406
Merge pull request #5 from namecheap/feat/set-output-deprecation
kurok ae2cb82
fix: silence DEP0169 url.parse deprecation from bundled aws-sdk v2
kurok 54459d6
Merge pull request #6 from namecheap/fix/aws-sdk-url-parse-deprecation
kurok 8b8869f
test: add jest unit tests for utils and config (Phase 8.a) (#16)
kurok a1bd2f9
feat: migrate aws-sdk v2 to @aws-sdk/client-ec2 v3 (Phase 1) (#17)
kurok 7b949a3
feat: non-root runner user, --ephemeral flag, configurable runner ver…
kurok 78f98d1
fix: revert non-root runner bootstrap, keep the rest of Phase 4 (#19)
kurok 249efbd
revert: full rollback of Phase 4 bootstrap to Phase 1 known-good (#21)
kurok b1b8d6d
feat: structured logging + opt-in debug mode (Phase 7) (#22)
kurok 46cf1d0
feat: retry + independent cleanup in stop (Phase 5) (#23)
kurok 6bb148b
feat: enforce IMDSv2 by default (Phase 6.a) (#24)
kurok fd15768
docs: OIDC-preferred + GitHub App token recommendations (Phases 2 + 3…
kurok 0fdd401
feat: Phase 4 (retry) — non-root runner + --ephemeral + hardcoded che…
kurok 7c6a9a7
feat: opt-in EBS encryption for runner root volume (Phase 6.b) (#27)
kurok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # ncc-bundled output contains source-embedded CR bytes inside string | ||
| # literals (aws-sdk deps, etc.). Treat the whole dist/ tree as binary | ||
| # so git's autocrlf doesn't strip them on commit, which otherwise | ||
| # produces a permanent mismatch between the committed blob and a | ||
| # fresh `npm run package` rebuild. | ||
| dist/** -text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,125 @@ | ||
| name: PR automations | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| lint-code: | ||
| name: Lint code | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
| - name: Cache dependencies | ||
| uses: actions/cache@v2 | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: '**/node_modules' | ||
| key: ec2-github-runner-${{ hashFiles('**/package-lock.json') }} | ||
| - name: Install packages | ||
| run: npm install | ||
| - name: Run linter | ||
| run: npm run lint | ||
|
|
||
| verify-dist: | ||
| name: Verify dist is up to date | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install packages | ||
| run: npm ci | ||
| - name: Rebuild dist | ||
| run: npm run package | ||
| - name: Fail if dist/ differs from committed copy | ||
| # ncc 0.38 produces code-split chunks alongside dist/index.js | ||
| # (e.g. dist/136.index.js); the whole dist/ tree must stay in | ||
| # sync with src/. | ||
| run: | | ||
| if ! git diff --quiet -- dist/ || [ -n "$(git status --porcelain -- dist/)" ]; then | ||
| echo "::error::dist/ is out of sync with src/." | ||
| echo "::error::Run 'npm run package' locally and commit the rebuilt dist/." | ||
| git status --porcelain -- dist/ | ||
| git diff --stat -- dist/ | ||
| exit 1 | ||
| fi | ||
|
|
||
| unit-tests: | ||
| name: Unit tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install packages | ||
| run: npm ci | ||
| - name: Run jest | ||
| run: npm test | ||
|
|
||
| verify-runner-url: | ||
| name: Verify pinned actions/runner release + checksum table | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Extract default runner version from action.yml | ||
| id: extract | ||
| run: | | ||
| # action.yml declares: | ||
| # runner-version: | ||
| # ... | ||
| # default: '2.333.1' | ||
| version=$(awk '/^ runner-version:/{found=1} found && /^ default:/{gsub(/[^0-9.]/, "", $2); print $2; exit}' action.yml) | ||
| if [ -z "$version" ]; then | ||
| echo "::error::Could not locate the default runner-version in action.yml" | ||
| exit 1 | ||
| fi | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
| echo "Default actions/runner: v$version" | ||
| - name: HEAD check the Linux x64 release asset | ||
| env: | ||
| VERSION: ${{ steps.extract.outputs.version }} | ||
| run: | | ||
| url="https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-x64-${VERSION}.tar.gz" | ||
| echo "Checking $url" | ||
| curl -fsSLI -o /dev/null "$url" | ||
| - name: Cross-check src/runner-checksums.js against release body | ||
| env: | ||
| VERSION: ${{ steps.extract.outputs.version }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| # Pull the release body once. | ||
| body=$(gh api "/repos/actions/runner/releases/tags/v${VERSION}" --jq .body) | ||
|
|
||
| # Extract upstream hashes from HTML-comment-wrapped markdown like: | ||
| # <!-- BEGIN SHA linux-x64 -->hex<!-- END SHA linux-x64 --> | ||
| upstream_x64=$(printf '%s' "$body" | grep -oE 'BEGIN SHA linux-x64 -->[a-f0-9]+' | cut -d'>' -f2) | ||
| upstream_arm64=$(printf '%s' "$body" | grep -oE 'BEGIN SHA linux-arm64 -->[a-f0-9]+' | cut -d'>' -f2) | ||
|
|
||
| if [ -z "$upstream_x64" ] || [ -z "$upstream_arm64" ]; then | ||
| echo "::error::Could not parse linux-x64 / linux-arm64 SHA from release body" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Extract committed hashes from src/runner-checksums.js by loading | ||
| # it as a Node module. The module exports { CHECKSUMS, lookup(...) }. | ||
| committed_x64=$(node -e "console.log(require('./src/runner-checksums').lookup('x64', process.env.VERSION) || '')") | ||
| committed_arm64=$(node -e "console.log(require('./src/runner-checksums').lookup('arm64', process.env.VERSION) || '')") | ||
|
|
||
| ok=true | ||
| if [ "$upstream_x64" != "$committed_x64" ]; then | ||
| echo "::error::runner-checksums.js x64-$VERSION ($committed_x64) != upstream ($upstream_x64)" | ||
| ok=false | ||
| fi | ||
| if [ "$upstream_arm64" != "$committed_arm64" ]; then | ||
| echo "::error::runner-checksums.js arm64-$VERSION ($committed_arm64) != upstream ($upstream_arm64)" | ||
| ok=false | ||
| fi | ||
| $ok | ||
| echo "Checksums verified for v$VERSION (x64 + arm64)." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
update to 24 here?