Skip to content
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

ROCKS 1452 - Refactor Build Rock workflow to be externally reusable #233

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
134291d
ROCKS 1452 - Refactor Build Rock workflow to be externally reusable
clay-lake Sep 6, 2024
962aa3c
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Sep 6, 2024
3007b0b
feat: added runner triplets to Image workflow
clay-lake Sep 6, 2024
a70a819
feat: added GithubOutput class
clay-lake Sep 8, 2024
11e9887
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Sep 9, 2024
f3514ef
feat: applied suggested changes from zhijie-yang
clay-lake Sep 9, 2024
3902e82
feat: added suggested changes from linostar
clay-lake Sep 9, 2024
7f362cb
fix(src/build_rock/configure/requirements.txt): added pydantic
clay-lake Sep 9, 2024
94a5722
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Sep 9, 2024
f5b8d15
Merge branch 'main' of https://github.com/canonical/oci-factory into …
clay-lake Sep 16, 2024
41f7d75
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Sep 16, 2024
a175429
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Sep 16, 2024
448b8a2
refactor: remove arch-map value from call to build-rock in Image work…
clay-lake Sep 23, 2024
3c5d295
feat: make default arch-map value use labels instead of runner name
clay-lake Sep 23, 2024
c3e30c9
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Sep 23, 2024
dacd870
fix: "Rock" now uses sentance case
clay-lake Oct 7, 2024
55ed796
fix(tests/data/rockcraft.yaml): added missing newline
clay-lake Oct 7, 2024
403d559
refactor(tests/etc/requirements.txt): test requirements.txt now refre…
clay-lake Oct 7, 2024
1bb9f6d
refactor: ran autoformatter on edited yaml files
clay-lake Oct 7, 2024
4cbf7c2
refactor(tests/fixtures/buffers.py): switch to tmp_path fixture
clay-lake Oct 8, 2024
151ddcd
Merge branch 'main' of https://github.com/canonical/oci-factory into …
clay-lake Oct 8, 2024
001ddde
fix: repair configure workflow after merge
clay-lake Oct 8, 2024
922dd23
Update .github/workflows/Build-Rock.yaml
clay-lake Oct 8, 2024
22a6236
refactor: remove dead step from repair
clay-lake Oct 8, 2024
b2e471d
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 8, 2024
73ef99a
fix: stray checkout
clay-lake Oct 8, 2024
b2ecdcf
refactor(src/build_rock/configure/generate_build_matrix.py): used def…
clay-lake Oct 8, 2024
34d14cd
refactor(.github/workflows/Build-Rock.yaml): extra line
clay-lake Oct 8, 2024
a22eb9d
test build: prototype dynamic branch selection
clay-lake Oct 8, 2024
ac8dee4
fix: set select branch name
clay-lake Oct 9, 2024
c0a869c
fix: switch to ref name
clay-lake Oct 9, 2024
34a2bbe
fix: corrected validation paths
clay-lake Oct 9, 2024
bdabf43
test buidl with debug statment
clay-lake Oct 9, 2024
cc48df3
test build
clay-lake Oct 9, 2024
842aa07
fix: correct glob behavior
clay-lake Oct 9, 2024
d73c323
fix: correct folder name validation
clay-lake Oct 9, 2024
296eb23
test build: check folder_name
clay-lake Oct 9, 2024
3670096
fix: disable image folder validation
clay-lake Oct 9, 2024
616f4db
test build
clay-lake Oct 9, 2024
3d342f3
feat: add access validation job
clay-lake Oct 9, 2024
d44fa58
trigger test build
clay-lake Oct 9, 2024
f4319ef
fix(.github/workflows/Build-Rock.yaml): invalid yaml syntax
clay-lake Oct 9, 2024
168bc23
fix: path validation and step namea
clay-lake Oct 9, 2024
445c324
refactor: move path validation outside of build rock repo
clay-lake Oct 9, 2024
3b0933b
feat: added job to image workflow for matrix validation
clay-lake Oct 9, 2024
426cdff
fix(Image.yaml): bad job name
clay-lake Oct 9, 2024
f988941
refactor(Image.yaml): adjust whitespace and comments
clay-lake Oct 9, 2024
3511bce
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 9, 2024
51968d1
test: github property exposing wf call params
clay-lake Oct 9, 2024
899df8c
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 9, 2024
9e21470
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 9, 2024
9430e88
feat: forward workflow ref to self checkout
clay-lake Oct 9, 2024
d62e023
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 9, 2024
786af95
test build
clay-lake Oct 9, 2024
4201240
test: canonical/get-workflow-version-action@v1
clay-lake Oct 9, 2024
5bd360c
fix: missing toJSON call
clay-lake Oct 9, 2024
d1e0edb
test: checkout self according to sha
clay-lake Oct 9, 2024
df5df0d
fix: bash syntax error
clay-lake Oct 9, 2024
271c535
fix: bash syntax error
clay-lake Oct 9, 2024
dc7b533
fix: syntax errors in workflow
clay-lake Oct 9, 2024
b6d8a23
fix: correct step name
clay-lake Oct 9, 2024
d7e543b
test: adaptor git checkout action
clay-lake Oct 9, 2024
fb7ee58
fix: missing file extension
clay-lake Oct 9, 2024
0e848d3
fix: bad action path
clay-lake Oct 9, 2024
67947b0
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 9, 2024
d500807
fix: ignore detached head
clay-lake Oct 9, 2024
c3880cb
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 9, 2024
a2d47ea
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 9, 2024
b1b62d7
fix: replace standard checkout procedure
clay-lake Oct 9, 2024
0abe3bf
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 9, 2024
54befd2
fix: clone self in runner-build
clay-lake Oct 10, 2024
23eefcb
fix: path in self checkout
clay-lake Oct 10, 2024
068107a
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 10, 2024
69c255b
fix: add rock identifier to each step in build.
clay-lake Oct 11, 2024
95cbdf2
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 11, 2024
0ef4512
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 11, 2024
b5af3fd
feat: added optional build identifier
clay-lake Oct 11, 2024
cae7784
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 11, 2024
bc09726
test build
clay-lake Oct 11, 2024
598dd91
test build
clay-lake Oct 11, 2024
7f7e605
test build
clay-lake Oct 11, 2024
5ead99b
test: build with optional build id
clay-lake Oct 14, 2024
7be1b4c
test: same as last build, fixed syntax
clay-lake Oct 14, 2024
85a9f29
test build
clay-lake Oct 14, 2024
d1ad574
test build without build-id
clay-lake Oct 14, 2024
5f29eb9
test build
clay-lake Oct 14, 2024
b0c0a07
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 14, 2024
d5d5675
feat: build-id paramter for identifying worflow jobs
clay-lake Oct 14, 2024
43931e8
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 14, 2024
dd3fe16
Merge branch 'main' of https://github.com/canonical/oci-factory into …
clay-lake Oct 14, 2024
a2978b2
refactor: reformatted python and applied yamllint fixes
clay-lake Oct 14, 2024
b85c44d
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 14, 2024
072878a
feat: add new non-EOL track for mock rock 1.0
clay-lake Oct 15, 2024
428f6d1
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 15, 2024
9661423
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 16, 2024
3eb2c73
Revert "feat: add new non-EOL track for mock rock 1.0"
clay-lake Oct 16, 2024
d2c13e8
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 16, 2024
18d5a16
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 16, 2024
8edab43
fix(/workspaces/oci-factory/.github/workflows/Build-Rock.yaml): missi…
clay-lake Oct 16, 2024
8923913
Merge branch 'ROCKS-1452/oci-factory-refactor-build-rock-to-be-extern…
clay-lake Oct 16, 2024
f3b2a5a
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Oct 16, 2024
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
52 changes: 52 additions & 0 deletions .github/actions/checkout/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Git Checkout
description: 'Checkout action supporting both github and non github repositories.'


inputs:
repository:
description: 'Github repository in the format owner/repo or external http(s) URL'
required: true
ref:
description: 'The branch, tag or SHA to checkout'
default: ''
path:
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
default: '.'
submodules:
description: 'Whether to checkout submodules. true|false|recursive according to actions/checkout@v4'
default: 'false'
github-server-url:
description: 'The base URL for the GitHub instance that you are trying to clone from'
default: 'https://github.com'

runs:
using: "composite"
steps:
- name: Checkout
shell: bash
run: |
# If URL lacks the protocol, assume it is a github repo
if [[ "${{ inputs.repository }}" =~ https?:// ]]
then
git_url="${{ inputs.repository }}"
else
git_url="${{ inputs.github-server-url }}/${{ inputs.repository }}.git"
fi
# create repo path relative to GITHUB_WORKSPACE as per actions/checkout@v4
repo_path="$GITHUB_WORKSPACE/${{ inputs.path }}"
# clone the repo and cd into it
git clone $git_url "$repo_path"
cd "$repo_path"
# checkout the correct ref
git config advice.detachedHead false
git checkout ${{ inputs.ref }}
# and update sub modules if required
if ${{ inputs.submodules == 'true' || inputs.submodules == 'recursive' }}
then
git submodule update ${{ inputs.submodules == 'recursive' && '--recursive' || '' }}
fi
Loading