-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge in CI/github-actions-runner from feature/example to master * commit 'f58fb6572b84100eaf9f4b33674dcf98d2d01795': fix identation fix typo remove fixme fix paths run example automatically activate workflow fix workflow names add example plan
- Loading branch information
Showing
4 changed files
with
158 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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,64 @@ | ||
# Example workflow for github-actions-runner | ||
name: Example | ||
|
||
env: | ||
NODE_VERSION: 20 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
## !NOTE: This input is required to identify the workflow run | ||
id: | ||
type: 'string' | ||
description: 'Unique identifier for the workflow run. Needed for github-actions-runner to identify the run.' | ||
push: | ||
branches: | ||
- 'feature/example' | ||
|
||
## !NOTE: This name is required to identify the workflow run | ||
run-name: ${{github.workflow}} [ID:${{ inputs.id }}] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Number of commits to fetch. 0 indicates all history. | ||
fetch-depth: 0 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: pnpm | ||
- name: Run bash commands | ||
shell: bash | ||
run: | | ||
ls -alt | ||
# Install deps | ||
pnpm install | ||
# Linting package | ||
pnpm lint | ||
# Testing package | ||
pnpm test | ||
# Building package artifact | ||
pnpm pack && mv adguard-github-actions-runner-*.tgz github-actions-runner.tgz | ||
- name: Save archived package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: github-actions-runner.tgz | ||
path: ./github-actions-runner.tgz | ||
- name: Save build.txt | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build.txt | ||
path: ./dist/build.txt |
This file contains 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 |
---|---|---|
|
@@ -12,3 +12,6 @@ | |
|
||
--- | ||
!include 'increment.yaml' | ||
|
||
--- | ||
!include 'example.yaml' |
This file contains 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 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,90 @@ | ||
--- | ||
version: 2 | ||
plan: | ||
project-key: AJL | ||
key: GHACTIONSRUNEXAMPLE | ||
name: github-actions-runner - example | ||
variables: | ||
# TODO set tag | ||
dockerNode: ghcr.io/adguardteam/githubactionsrunner:master | ||
|
||
stages: | ||
- Build: | ||
manual: false | ||
final: false | ||
jobs: | ||
- Build | ||
|
||
Build: | ||
key: BUILD | ||
other: | ||
clean-working-dir: true | ||
docker: | ||
image: ${bamboo.dockerNode} | ||
volumes: | ||
${system.PNPM_DIR}: "${bamboo.cachePnpm}" | ||
tasks: | ||
- checkout: | ||
force-clean-build: true | ||
- script: | ||
interpreter: SHELL | ||
scripts: | ||
- |- | ||
set -x | ||
set -e | ||
# Fix mixed logs | ||
exec 2>&1 | ||
ls -laht | ||
branch="${bamboo_planRepository_branchName}" | ||
revision="${bamboo_planRepository_revision}" | ||
# FIXME use github-actions-runner binary after it will be exposed in the docker | ||
GITHUB_TOKEN=${bamboo.githubActionsRunnerPassword} github-actions-runner run-action --repo AdguardTeam/GithubActionsRunner --branch "$branch" --rev "$revision" --workflow example.yml --artifacts-path . | ||
final-tasks: | ||
- script: | ||
interpreter: SHELL | ||
scripts: | ||
- |- | ||
set -x | ||
set -e | ||
# Fix mixed logs | ||
exec 2>&1 | ||
ls -laht | ||
echo "Size before cleanup:" && du -h | tail -n 1 | ||
rm -rf node_modules | ||
echo "Size after cleanup:" && du -h | tail -n 1 | ||
artifacts: | ||
- name: github-actions-runner.tgz | ||
pattern: github-actions-runner.tgz | ||
shared: true | ||
required: true | ||
requirements: | ||
- adg-docker: 'true' | ||
|
||
triggers: [] | ||
|
||
branches: | ||
create: for-pull-request | ||
delete: | ||
after-deleted-days: '1' | ||
after-inactive-days: '5' | ||
link-to-jira: true | ||
|
||
notifications: | ||
- events: | ||
- plan-status-changed | ||
recipients: | ||
- webhook: | ||
name: Build webhook | ||
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo | ||
|
||
labels: [] | ||
|
||
other: | ||
concurrent-build-plugin: system-default |