Skip to content

Commit

Permalink
add build/test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
its-felix committed Nov 10, 2023
1 parent cee00b6 commit a8a8c1d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 18 deletions.
30 changes: 30 additions & 0 deletions .github/actions/build_and_test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Build, Test'

inputs:
inputs:
working-directory:
type: string
required: true
output:
type: string
required: true

runs:
using: 'composite'
steps:
- name: 'Setup go ${{ env.GO_VERSION }}'
uses: actions/setup-go@v4
with:
go-version: '^1.21'
- name: 'Test'
working-directory: ${{ inputs.working-directory }}
run: 'go test ./...'
shell: bash
- name: 'Build'
working-directory: ${{ inputs.working-directory }}
env:
GOOS: 'linux'
GOARCH: 'amd64' # keep this in sync with the arch configured in CDK!
CGO_ENABLED: '0'
run: 'go build -o ${{ inputs.output }} -tags "lambda,lambda.norpc,lambdahttpadapter.partial,lambdahttpadapter.echo,lambdahttpadapter.functionurl"'
shell: bash
34 changes: 16 additions & 18 deletions .github/workflows/trigger_monorepo_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@ on:
- '*'

jobs:
create_monorepo_cr:
name: 'Trigger monorepo workflow'
build_and_test:
name: 'Build, Test'
runs-on: ubuntu-latest
steps:
- name: 'Trigger monorepo workflow'
uses: actions/github-script@v6
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Build, Test'
uses: './.github/actions/build_and_test'
with:
github-token: ${{ secrets.MONOREPO_DISPATCH_PAT }}
script: |
const { owner, repo } = context.repo;
await github.rest.actions.createWorkflowDispatch({
owner: owner,
repo: 'gw2auth.com-monorepo',
workflow_id: 'create_pr_for_submodule.yml',
ref: 'beta',
inputs: {
submodule: repo,
submodule_ref: context.sha,
submodule_branch: context.ref,
},
});
working-directory: '.'
output: 'bootstrap'

trigger_monorepo_workflow:
name: 'Trigger monorepo workflow'
needs:
- build_and_test
uses: gw2auth/gw2auth.com-monorepo/.github/workflows/trigger_monorepo_workflow.yml@beta
secrets:
token: ${{ secrets.MONOREPO_DISPATCH_PAT }}

0 comments on commit a8a8c1d

Please sign in to comment.