-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install Packer as a binary in user's path instead of being an interfa…
…ce for users to run Packer commands (#63) * updates Actions config * updates docs * Remove unused code that was moved to the core library, update to hashicorp version of GHA-Core, which is currently still private Co-authored-by: Kerim Satirli <[email protected]> Co-authored-by: Alexey Kulakov <[email protected]>
- Loading branch information
1 parent
8c999b2
commit ae6b3ed
Showing
21 changed files
with
25,327 additions
and
280 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
--- | ||
name: "Security Scan: Snyk Code" | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
snyk: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
# see https://github.com/snyk/actions/tree/master/node | ||
- name: Lint Code with Snyk | ||
uses: snyk/actions/node@master | ||
env: | ||
# see https://github.com/snyk/actions#getting-your-snyk-token | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
# see https://github.com/snyk/actions/tree/master/node#uploading-snyk-scan-results-to-github-code-scanning | ||
args: --policy-path=.snyk --sarif-file-output=snyk.sarif --org=${{ secrets.SNYK_ORG }} | ||
|
||
# # see https://github.com/github/codeql-action/tree/main/upload-sarif | ||
# - name: Upload Snyk IaC results to GitHub Code Scanning | ||
# uses: github/codeql-action/upload-sarif@v2 | ||
# with: | ||
# sarif_file: snyk.sarif |
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,26 @@ | ||
--- | ||
name: "Code Quality: Super-Linter" | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
superlinter: | ||
name: Super-Linter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
|
||
- name: Lint Code with Super-Linter | ||
uses: github/super-linter@v4 | ||
env: | ||
VALIDATE_ALL_CODEBASE: true | ||
DEFAULT_BRANCH: "main" | ||
DISABLE_ERRORS: false | ||
JAVASCRIPT_DEFAULT_STYLE: "prettier" | ||
VALIDATE_JSON: true | ||
VALIDATE_MD: true |
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,70 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
jobs: | ||
setup-packer: | ||
runs-on: ubuntu-latest | ||
name: Test setup-packer | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
## TODO: should use whatever current branch is, not hardcoded brnach | ||
- name: Setup `packer` from renamed action | ||
uses: hashicorp/setup-packer@main | ||
id: setup | ||
with: | ||
version: "1.8.1" | ||
|
||
- name: Print `$PATH` | ||
run: which packer | ||
|
||
- name: Print packer version | ||
run: packer version | ||
|
||
- name: Validate Packer version is latest (1.8.1) | ||
run: if packer version | grep -q "Packer v1.8.1"; then echo "passed"; else exit 1; fi; | ||
|
||
- name: Run `packer` init | ||
run: packer init "${{ github.action_path }}./test/hello-world.pkr.hcl" | ||
|
||
- name: Try to setup packer for an invalid verison | ||
uses: hashicorp/setup-packer@main | ||
id: ranch | ||
with: | ||
version: "ranch" | ||
continue-on-error: true | ||
|
||
- name: Validate invalid version failed | ||
if: steps.ranch.outcome == 'success' | ||
run: echo "Installing an invalid version expected to fail but did not" && exit 1 | ||
|
||
- name: Try to setup packer for a verison that has yet to be released | ||
uses: hashicorp/setup-packer@main | ||
id: packer3 | ||
with: | ||
version: "3.0.0" | ||
continue-on-error: true | ||
|
||
- name: Validate invalid version failed | ||
if: steps.packer3.outcome == 'success' | ||
run: echo "Installing a non existant expected to fail but did not" && exit 1 | ||
|
||
- name: No version defaults to latest | ||
uses: hashicorp/setup-packer@main | ||
id: latest | ||
|
||
## TODO, don't hardcode version | ||
- name: Validate Packer version is latest (currently hardcoded, need to refactor) | ||
run: if packer version | grep -q "Packer v1.8.4"; then echo "passed"; else exit 1; fi; | ||
|
||
- name: Print packer version | ||
run: packer version | ||
|
||
- name: Run `packer` init | ||
run: packer init "${{ github.action_path }}./test/hello-world.pkr.hcl" |
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,35 @@ | ||
--- | ||
name: "Code Quality: TypeScript" | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
nodejs: | ||
name: Node.js | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast | ||
fail-fast: false | ||
matrix: | ||
node-version: | ||
- 18.x | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
|
||
- name: Install NPM Packages | ||
run: npm ci | ||
|
||
- name: Build TypeScript code | ||
run: npm run build |
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,3 @@ | ||
# TODO: generate dist folder in CI | ||
# dist/ | ||
node_modules/ |
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,11 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"bracketSpacing": false, | ||
"parser": "typescript", | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "es5", | ||
"useTabs": false | ||
} |
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,34 @@ | ||
{ | ||
"git": { | ||
"changelog": "git log --pretty=format:\"* %s (%h)\" ${from}...${to}", | ||
"commit": true, | ||
"commitArgs": ["-S"], | ||
"commitMessage": "Release v${version}", | ||
"requireBranch": false, | ||
"requireCleanWorkingDir": true, | ||
"requireCommits": true, | ||
"requireUpstream": true, | ||
"addUntrackedFiles": false, | ||
"push": true, | ||
"tag": true, | ||
"tagAnnotation": "Release v${version}" | ||
}, | ||
|
||
"github": { | ||
"autoGenerate": true, | ||
"draft": true, | ||
"host": null, | ||
"release": false, | ||
"releaseName": "Release v${version}", | ||
"releaseNotes": true, | ||
"skipChecks": true, | ||
"timeout": 0, | ||
"web": true | ||
}, | ||
|
||
"hooks": {}, | ||
|
||
"npm": { | ||
"publish": false | ||
} | ||
} |
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,19 @@ | ||
version: v1.25.0 | ||
|
||
# see https://docs.snyk.io/snyk-cli/test-for-vulnerabilities/the-.snyk-file?q= | ||
ignore: | ||
# see https://security.snyk.io/vuln/snyk:lic:npm:hashicorp:js-releases:MPL-2.0] | ||
'snyk:lic:npm:hashicorp:js-releases:MPL-2.0': | ||
- '@hashicorp/js-releases': | ||
reason: acceptable license | ||
expires: 2023-12-31T00:00:00.000Z | ||
created: 2022-08-16T00:00:00.000Z | ||
|
||
# see https://security.snyk.io/vuln/snyk:lic:npm:openpgp:LGPL-3.0 | ||
'snyk:lic:npm:openpgp:LGPL-3.0': | ||
- '@hashicorp/js-releases > openpgp': | ||
reason: acceptable license | ||
expires: 2023-12-31T00:00:00.000Z | ||
created: 2022-08-16T00:00:00.000Z | ||
|
||
patch: {} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.