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

Modernize the action #7

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 0 additions & 6 deletions .github/dependabot.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["github>open-turo/renovate-config#v1"]
}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches: [main]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: open-turo/actions-gha/lint@v1
- uses: open-turo/actions-gha/lint@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: open-turo/actions-gha/test@v1
- uses: open-turo/actions-gha/test@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ name: Release

on:
push:
branches: [main]
branches: [main, "v*"]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: open-turo/actions-gha/lint@v1
- uses: open-turo/actions-gha/lint@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: open-turo/actions-gha/test@v1
- uses: open-turo/actions-gha/test@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -30,6 +30,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: open-turo/actions-gha/release@v1
- uses: open-turo/actions-gha/release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/security-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Security scan

on:
pull_request: {}
workflow_dispatch: {}
push:
branches: [main]

jobs:
security-scan:
name: Security scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: open-turo/actions-security/static-analysis@v1
with:
semgrep-app-token: ${{ secrets.SEMGREP_APP_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/update-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Update dependencies
concurrency: update-dependencies

on:
schedule:
# Every day at midnight
- cron: "0 0 * * *"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to consider running this weekly instead and not every day?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I think we could instead use the renovatebot schedule instead https://docs.renovatebot.com/key-concepts/scheduling/ and add these to our presets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try to do as part of open-turo/renovate-config

workflow_dispatch:
issue_comment:
types:
- edited
pull_request:
types:
- edited

jobs:
update-dependencies:
runs-on: ubuntu-latest
name: Update dependencies
# Only run in turo-dependency-manager PRs or when manually triggered or as part of a schedule
if: (github.event_name == 'issue_comment' && github.event.issue.user.login == 'turo-dependency-manager') || (github.event_name == 'pull_request' && github.actor == 'turo-dependency-manager') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: Update dependencies
uses: open-turo/action-renovate@v1
with:
github-token: ${{ secrets.TURO_GITHUB_DEPENDENCY_MANAGER_TOKEN }}
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0 # Use the ref you want to point at
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
- id: pretty-format-json
args:
- --autofix
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
rev: v3.1.0
hooks:
- id: prettier
stages: [commit]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v8.0.0
rev: v9.9.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@open-turo/commitlint-config-conventional"]
- repo: https://github.com/rhysd/actionlint
rev: v1.6.8
rev: v1.6.26
hooks:
- id: actionlint
14 changes: 1 addition & 13 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
{
"branches": [
"main",
{
"channel": "next",
"name": "(f|b|c)/*",
"prerelease": "beta-<%= (/^\\w+-\\d+/.exec(name.substr(2)) || [])[0] %>"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
"extends": "@open-turo/semantic-release-config"
}
35 changes: 1 addition & 34 deletions run-sync/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,7 @@ runs:
- name: setup docker-compose.yaml
working-directory: ${{ runner.temp }}/kubesealer
shell: bash
run: |

cat << EOF > docker-compose.yaml
version: "3.4"

services:
op-connect-api:
image: 1password/connect-api:latest
ports:
- "8080:8080"
volumes:
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.json"
- "data:/home/opuser/.op/data"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/heartbeat"]
interval: 2s
timeout: 1s
retries: 5
start_period: 5s
op-connect-sync:
image: 1password/connect-sync:latest
ports:
- "8081:8080"
volumes:
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.json"
- "data:/home/opuser/.op/data"
kubesealer:
image: turo/kubesealer:latest
env_file: .env

volumes:
data:

EOF
run: cp ${{ github.action_path }}/docker-compose.yaml .

- name: docker versions
shell: bash
Expand Down
29 changes: 29 additions & 0 deletions run-sync/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "3.4"

services:
op-connect-api:
image: 1password/connect-api:latest
ports:
- "8080:8080"
volumes:
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.json"
- "data:/home/opuser/.op/data"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/heartbeat"]
interval: 2s
timeout: 1s
retries: 5
start_period: 5s
op-connect-sync:
image: 1password/connect-sync:latest
ports:
- "8081:8080"
volumes:
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.json"
- "data:/home/opuser/.op/data"
kubesealer:
image: turo/kubesealer:4.11.0
env_file: .env

volumes:
data:
15 changes: 15 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# script/bootstrap: Resolve all dependencies that the application requires to
# run.

set -e

cd "$(dirname "$0")/.."

# Local only checks
if [[ $CI != "true" ]]; then
echo -e "==> Setting up commit hooks"
pre-commit install
pre-commit install --hook-type commit-msg
fi
10 changes: 10 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# script/setup: Set up application for the first time after cloning, or set it
# back to the initial first unused state.

set -e

cd "$(dirname "$0")/.."

script/bootstrap
Loading