Allow ./... as a build target

This commit is contained in:
Patrick Carlisle
2022-06-15 16:51:21 -06:00
committed by Lane Seppala
parent 054f21a184
commit 3b63e35f41
4 changed files with 30 additions and 17 deletions
+25 -12
View File
@@ -1,18 +1,31 @@
name: Go Action detection of dependencies name: 'build-test'
on: on: # rebuild any PRs and main branch changes
push pull_request:
branches:
- main
- 'releases/*'
push:
branches:
- main
- 'releases/*'
jobs: jobs:
go-action-detection: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'Checkout Repository' - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: Install Node
uses: actions/setup-node@v3
with: with:
go-version: ">=1.18.0" node-version: 16
- name: Run snapshot action registry-url: 'https://npm.pkg.github.com'
uses: dsp-testing/go-snapshot-action@main env:
with: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
go-mod-path: go-example/go.mod
go-build-target: go-example/cmd/octocat.go - run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- run: npm rebuild && npm run all
+2 -2
View File
@@ -55,8 +55,8 @@ function main() {
throw new Error(`${goModPath} is not a go.mod file or does not exist!`); throw new Error(`${goModPath} is not a go.mod file or does not exist!`);
} }
const goModDir = path_1.default.dirname(goModPath); const goModDir = path_1.default.dirname(goModPath);
let goBuildTarget = path_1.default.normalize(core.getInput('go-build-target')); let goBuildTarget = core.getInput('go-build-target');
if (goBuildTarget !== 'all' && goBuildTarget !== '...') { if (goBuildTarget !== 'all' && goBuildTarget !== './...') {
if (!fs_1.default.existsSync(goBuildTarget)) { if (!fs_1.default.existsSync(goBuildTarget)) {
throw new Error(`The build target '${goBuildTarget}' does not exist`); throw new Error(`The build target '${goBuildTarget}' does not exist`);
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -15,9 +15,9 @@ async function main () {
} }
const goModDir = path.dirname(goModPath) const goModDir = path.dirname(goModPath)
let goBuildTarget = path.normalize(core.getInput('go-build-target')) let goBuildTarget = core.getInput('go-build-target')
if (goBuildTarget !== 'all' && goBuildTarget !== '...') { if (goBuildTarget !== 'all' && goBuildTarget !== './...') {
if (!fs.existsSync(goBuildTarget)) { if (!fs.existsSync(goBuildTarget)) {
throw new Error(`The build target '${goBuildTarget}' does not exist`) throw new Error(`The build target '${goBuildTarget}' does not exist`)
} }