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

Refactoring CI pipeline in preparation for documenting it #1152

Merged
merged 8 commits into from
Oct 2, 2020

Conversation

pshomov
Copy link
Contributor

@pshomov pshomov commented Oct 1, 2020

Supports #389

What

Pull parts of the GHA in scripts that can be run locally

Why

See https://github.com/island-is/handbook/blob/master/docs/adr/0002-continuous-integration.md#decision-drivers-policy

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against master before asking for a review

@pshomov pshomov requested a review from a team as a code owner October 1, 2020 11:57
@pshomov pshomov requested a review from sindrig October 1, 2020 11:57
eirikurn
eirikurn previously approved these changes Oct 1, 2020
Copy link
Member

@eirikurn eirikurn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@@ -111,7 +89,7 @@ jobs:
else
export PUBLISH=true
fi
echo "::set-env name=PUBLISH::${PUBLISH}"
export PUBLISH=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know this is WIP but still

@@ -134,10 +112,6 @@ jobs:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-yarn

- name: Building NodeJS dependencies - host OS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably ditto?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we put both dependence updates in the same script

@@ -154,61 +128,45 @@ jobs:
run: echo "::set-env name=BRANCH::${GIT_BRANCH}"

- name: Security audit Node modules
run: yarn run security-audit
run: ./scripts/security-audit.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why create scripts for one liners?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Longer discussion, let's have it "live" ;)


source $DIR/_common.sh

cd $PROJECT_ROOT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest doing this in subshell

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@@ -7,6 +7,10 @@ source $DIR/_common.sh

# Build the node_modules as well as the base image for the final outputs and store it in the shared cache so it can be reused later

cd $PROJECT_ROOT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, subshell

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@pshomov pshomov changed the title WIP: Refactoring CI pipeline in preparation for documenting it Refactoring CI pipeline in preparation for documenting it Oct 1, 2020
@pshomov pshomov requested a review from sindrig October 2, 2020 09:27
@pshomov pshomov added the automerge Merge this PR as soon as all checks pass label Oct 2, 2020
@@ -148,67 +123,51 @@ jobs:

- name: Building NodeJS dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only thing I can see is that we might want to check the cache-hit status of steps.node-modules.outputs.cache-hit as well - I know it depends on the same file but if one was invalidated somehow or something... /shrug

@kodiakhq kodiakhq bot merged commit fee9bf7 into master Oct 2, 2020
@kodiakhq kodiakhq bot deleted the infra/ci-documentation branch October 2, 2020 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants