-
Notifications
You must be signed in to change notification settings - Fork 47
Move CI from TravisCI to GitHub Actions #339
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
14ee479
e3812d1
efc1449
3c65f2f
b8d312c
87ea1f1
d581404
ccd16ed
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow will put the project in our staging repo | ||
name: Releasing Project to maven | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
build: | ||
if: endsWith(github.ref, "-lib") | ||
env: | ||
AWS_DEFAULT_REGION: us-east-1 | ||
AWS_REGION: us-east-1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Java & publishing credentials | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml | ||
server-username: SONATYPE_USERNAME # env variable for username in deploy | ||
server-password: SONATYPE_PASSWORD # env variable for token in deploy | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | ||
- name: Deploy to sonatype staging repo | ||
run: mvn deploy -Ppublishing | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
Comment on lines
+15
to
+31
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. confused what's going on with looks similar to 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. i think it's to limit the scope of when these secrets are on the build machine. the setup-java step simply creates a configuration file which points to environment variables then the deploy step sets these when the configuration file is actually used (during the |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,49 @@ | ||||||
# This workflow will install dependencies, run tests for both plugin and library components | ||||||
name: CloudFormation CLI Java Plugin Pull Request CI | ||||||
|
||||||
on: | ||||||
push: | ||||||
branches: [ master ] | ||||||
pull_request: | ||||||
branches: [ master ] | ||||||
|
||||||
jobs: | ||||||
build: | ||||||
env: | ||||||
AWS_DEFAULT_REGION: us-east-1 | ||||||
AWS_REGION: us-east-1 | ||||||
PatMyron marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
strategy: | ||||||
matrix: | ||||||
python: [3.6, 3.7, 3.8] | ||||||
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. linking aws-cloudformation/cloudformation-cli-python-plugin#139 again just so we don't forget later
Suggested change
|
||||||
java: [8, 11] | ||||||
runs-on: ubuntu-latest | ||||||
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. might as well test on 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. added. i think it might also be useful to test compatibility with published libraries and plugins i.e. since we are managing two different packages of software, we should test the library against the published plugin and vice versa to ensure backwards compatibility. These things get missed since we test the built library in a given PR with the built plugin in the given PR 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. seeing some macos failures trying to build the java library. going to leave out the multiple OS testing for now since this was just supposed to be a migration and create a followup so we can do this in a more targeted way where we aren't just running 18 jobs for one pr. ideally we'd only need to test compatibility of the plugin with the given OS |
||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- name: Set up Python ${{ matrix.python }} | ||||||
uses: actions/setup-python@v2 | ||||||
with: | ||||||
python-version: ${{ matrix.python }} | ||||||
- name: Set up Java ${{ matrix.java }} | ||||||
uses: actions/setup-java@v1 | ||||||
with: | ||||||
java-version: ${{ matrix.java }} | ||||||
- name: Install python dependencies | ||||||
run: | | ||||||
pip install --upgrade 'attrs==19.2.0' wheel -r https://raw.githubusercontent.com/aws-cloudformation/cloudformation-cli/master/requirements.txt | ||||||
- name: Install cloudformation-cli-java-plugin | ||||||
run: | | ||||||
pip install . | ||||||
- name: Run pre-commit, twine checks for cloudformation-cli-java-plugin | ||||||
run: | | ||||||
pre-commit run --all-files | ||||||
python setup.py sdist bdist_wheel | ||||||
twine check ./dist/* | ||||||
- name: Verify java package | ||||||
run: | ||||||
mvn verify | ||||||
- name: Integration standard e2e | ||||||
run: | ||||||
./e2e_test.sh 1 | ||||||
- name: Integration guided e2e | ||||||
run: | ||||||
./e2e_test.sh 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This workflow will release project to PyPI | ||
name: CloudFormation CLI Java Plugin Release | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
build: | ||
if: endsWith(github.ref, "-plugin") | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade wheel twine | ||
- name: Package project | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Publish distribution 📦 to PyPI (If triggered from release) | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_KEY_CLOUDFORMATION_CLI_JAVA_PLUGIN }} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
DIR=$(mktemp -d) | ||
cd "$DIR" | ||
ls -la | ||
|
||
printf "\n\n$1" | cfn init -t AWS::Foo::Bar -a RESOURCE -vv | ||
ls -la | ||
mvn verify |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -431,6 +431,12 @@ | |
<goals> | ||
<goal>sign</goal> | ||
</goals> | ||
<configuration> | ||
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. Had to add this to pick up the passphrase for the gpg key that is set in the setup java step |
||
<gpgArguments> | ||
<arg>--pinentry-mode</arg> | ||
<arg>loopback</arg> | ||
</gpgArguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
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.
Are these environment variables used for anything btw?
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.
yeah if you dont have these set the unit tests fail 🤷🏻 something with initializing aws clients in unit tests. maybe at a later date we can look into why these are necessary are try to remove