From ba9707a9ccf58065d61c3898007e86d3a64d9cd1 Mon Sep 17 00:00:00 2001 From: Timothy MacDonald Date: Thu, 4 Apr 2024 08:30:30 -0500 Subject: [PATCH] ci: migrate from codefresh to github actions (#95) * ci: migrate from codefresh to github actions Signed-off-by: Timothy MacDonald * ci: update job name in test compat workflow Signed-off-by: Timothy MacDonald * ci: temp switch to testing branch of oss-actions Signed-off-by: Timothy MacDonald * ci: switch back to main branch of oss-actions Signed-off-by: Timothy MacDonald --------- Signed-off-by: Timothy MacDonald --- .github/workflows/nightly.yml | 8 +++--- .github/workflows/release.yml | 8 ++++-- .github/workflows/test-compat-pr-comment.yml | 29 ++++++++++++++++++++ .github/workflows/test-compatibility.yml | 11 ++++++-- .github/workflows/verify-release.yml | 6 +++- 5 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test-compat-pr-comment.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8daf7a2..80b2156 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,9 +1,9 @@ name: Nightly Build -on: workflow_dispatch - - # schedule: - # - cron: '0 10 * * *' # Run every day at 10AM UTC +on: + workflow_dispatch: + schedule: + - cron: '0 10 * * *' # Run every day at 10AM UTC jobs: call-nightly-workflow: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7de7fea..1dfdd5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,11 @@ name: Release -on: workflow_dispatch - +on: + workflow_dispatch: + push: + tags: + - 'v*' + jobs: call-nightly-workflow: uses: lacework/oss-actions/.github/workflows/tf-release.yml@main diff --git a/.github/workflows/test-compat-pr-comment.yml b/.github/workflows/test-compat-pr-comment.yml new file mode 100644 index 0000000..5202b0e --- /dev/null +++ b/.github/workflows/test-compat-pr-comment.yml @@ -0,0 +1,29 @@ +name: Test Compatibility On Comment + +on: + workflow_dispatch: + issue_comment: + types: [created, edited] + +jobs: + check-commenting-user: + runs-on: ubuntu-latest + if: ${{ contains(github.event.comment.html_url, '/pull/') && contains(github.event.comment.body, 'make it so') }} + steps: + - uses: actions/github-script@v7 + with: + script: | + const creator = context.payload.sender.login + const result = await github.rest.teams.getMembershipForUserInOrg({ + org: context.repo.owner, + team_slug: 'growth-team', + username: creator + }) + if (result.state != "active" ) { + core.setFailed('Commenter is not a member of the growth team.') + } + + call-test-compat: + needs: check-commenting-user + uses: lacework/oss-actions/.github/workflows/tf-test-compatibility.yml@main + secrets: inherit diff --git a/.github/workflows/test-compatibility.yml b/.github/workflows/test-compatibility.yml index 99f73e2..ae40a30 100644 --- a/.github/workflows/test-compatibility.yml +++ b/.github/workflows/test-compatibility.yml @@ -1,8 +1,13 @@ name: Test Compatibility -on: workflow_dispatch - +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + jobs: - call-nightly-workflow: + call-test-compat: uses: lacework/oss-actions/.github/workflows/tf-test-compatibility.yml@main secrets: inherit diff --git a/.github/workflows/verify-release.yml b/.github/workflows/verify-release.yml index 6823ff0..e390fcc 100644 --- a/.github/workflows/verify-release.yml +++ b/.github/workflows/verify-release.yml @@ -1,6 +1,10 @@ name: Verify Release -on: workflow_dispatch +on: + workflow_dispatch: + push: + branches: + - release jobs: call-nightly-workflow: