Skip to content
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

Move workflow files to master #2

Merged
merged 8 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/enverus-lambda-runner-binaries-syncer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lambda Syncer
on:
push:
branches:
- develop
pull_request:
paths:
- .github/workflows/lambda-runner-binaries-syncer.yml
- "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/**"

jobs:
build:
runs-on: ubuntu-latest
container: node:14
defaults:
run:
working-directory: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn install
- name: Run prettier
run: yarn format-check
- name: Run linter
run: yarn lint
- name: Run tests
run: yarn test
- name: Build distribution
run: yarn build
34 changes: 34 additions & 0 deletions .github/workflows/enverus-lambda-runners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lambda Runners
on:
push:
branches:
- develop
pull_request:
paths:
- .github/workflows/lambda-runners.yml
- "modules/runners/lambdas/runners/**"

jobs:
build:
runs-on: ubuntu-latest
container: node:14
defaults:
run:
working-directory: modules/runners/lambdas/runners

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn install
- name: Run prettier
run: yarn format-check
- name: Run linter
run: yarn lint
- name: Run tests
run: yarn test
- name: Run two tests in isolation
run: |
yarn run test src/scale-runners/scale-up.test.ts -t 'scaleUp with GHES on org level creates a runner with labels in s specific group' --coverage=false
yarn run test src/scale-runners/scale-up.test.ts -t 'scaleUp with public GH on org level creates a runner with labels in s specific group' --coverage=false
- name: Build distribution
run: yarn build
30 changes: 30 additions & 0 deletions .github/workflows/enverus-lambda-webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lambda Webhook
on:
push:
branches:
- develop
pull_request:
paths:
- .github/workflows/lambda-webhook.yml
- "modules/webhook/lambdas/webhook/**"

jobs:
build:
runs-on: ubuntu-latest
container: node:14
defaults:
run:
working-directory: modules/webhook/lambdas/webhook

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn install
- name: Run prettier
run: yarn format-check
- name: Run linter
run: yarn lint
- name: Run tests
run: yarn test
- name: Build distribution
run: yarn build
84 changes: 84 additions & 0 deletions .github/workflows/enverus-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Enverus Release build

on:
push:
branches:
- master
- develop
workflow_dispatch:

jobs:
prepare:
name: Create dist
runs-on: ubuntu-latest
container: node:14
strategy:
matrix:
lambda: ["modules/webhook/lambdas/webhook", "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer", "modules/runners/lambdas/runners"]
steps:
- name: Extract lambda name
id: lambda
env:
LAMBDA: ${{ matrix.lambda }}
run: echo ::set-output name=name::${LAMBDA##*/}
- uses: actions/checkout@v3
- name: Add zip
run: apt update && apt install zip
- name: Build dist
working-directory: ${{ matrix.lambda }}
run: yarn install && yarn run test && yarn dist
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.lambda.outputs.name }}
path: ${{ matrix.lambda }}/${{ steps.lambda.outputs.name }}.zip
retention-days: 1

release:
name: release
runs-on: ubuntu-latest
needs:
prepare
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v2
with:
name: webhook
path: artifacts
- uses: actions/download-artifact@v2
with:
name: runners
path: artifacts
- uses: actions/download-artifact@v2
with:
name: runner-binaries-syncer
path: artifacts

- name: Get installation token
uses: npalm/[email protected]
id: app-token
with:
appId: ${{ secrets.FOREST_RELEASER_APP_ID }}
appPrivateKeyBase64: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
appInstallationType: repo
appInstallationValue: ${{ github.repository }}

- name: Dry run release
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Read only token
run: |
cp .release/* .
yarn
yarn release -d --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git

- name: Release
if: github.event_name != 'pull_request' && contains('refs/heads/develop', github.ref)
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
cp .release/* .
yarn
yarn release --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git