Skip to content

Commit

Permalink
Prepares for CI and effect modules
Browse files Browse the repository at this point in the history
  • Loading branch information
fedefernandez committed Jul 8, 2023
1 parent 5674866 commit df3ff53
Show file tree
Hide file tree
Showing 27 changed files with 1,103 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pre:
docs: 'gem install jekyll -v 4'
11 changes: 11 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/47degrees/.github
# If you want to suggest a change, please open a PR or issue in that repository

enhancement: ['enhancement/*', 'feature/*']
documentation: ['docs/*', 'doc/*']
breaking-change: ['breaking/*', 'break/*']
bug: ['bug/*', 'fix/*']
tests: ['test/*', 'tests/*']
dependency-update: ['dep/*', 'dependency/*', 'dependency-update/*']
scala-steward: ['update/*']
63 changes: 63 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/47degrees/.github
# If you want to suggest a change, please open a PR or issue in that repository

name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
exclude-labels:
- 'auto-update'
- 'auto-documentation'
- 'auto-changelog'
categories:
- title: '⚠️ Breaking changes'
label: 'breaking-change'
- title: '🚀 Features'
label: 'enhancement'
- title: '📘 Documentation'
label: 'documentation'
- title: '🐛 Bug Fixes'
label: 'bug'
- title: '📈 Dependency updates'
labels:
- 'dependency-update'
- 'scala-steward'
template: |
## What's changed
$CHANGES
## Contributors to this release
$CONTRIBUTORS
autolabeler:
- label: "enhancement"
branch:
- '/enhancement\/.+/'
- '/feature\/.+/'
- label: "documentation"
files:
- "*.md"
branch:
- '/docs\/.+/'
- '/doc\/.+/'
- label: "breaking-change"
branch:
- '/breaking\/.+/'
- '/break\/.+/'
- label: "bug"
branch:
- '/bug\/.+/'
- '/fix\/.+/'
- label: "tests"
branch:
- '/test\/.+/'
- '/tests\/.+/'
- label: "dependency-update"
branch:
- '/dep\/.+/'
- '/dependency\/.+/'
- '/dependency-update\/.+/'
- label: "scala-steward"
branch:
- '/update\/.+/'
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/47degrees/.github
# If you want to suggest a change, please open a PR or issue in that repository

name: Formatters & Tests

on:
push:
branches: [main]
pull_request:

jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout project (pull-request)
if: github.event_name == 'pull_request'
uses: actions/[email protected]
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Checkout project (main)
if: github.event_name == 'push'
uses: actions/checkout@v2
- name: Setup Scala
uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
- name: Setup yq
run: sudo snap install yq
- name: Run pre-conditions
run: test -f .github/actions.yml && eval "$(yq e '.pre.ci // "true"' .github/actions.yml)" || true
- name: Run scalafmt on Scala Steward PRs
if: github.event.pull_request.user.login == '47erbot' && contains(github.event.pull_request.body, 'Scala Steward')
run: sbt "scalafixEnable; fix" || sbt "scalafmtAll; scalafmtSbt" || true
- name: Push changes
uses: stefanzweifel/[email protected]
with:
commit_message: Run formatter/linter
- name: Restore cached github responses
id: cache-github-restore
uses: actions/cache/restore@v3
with:
path: |
target/github-responses
key: github-cache
- name: Run checks
run: sbt ci-test
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Save cached github responses
id: cache-github-save
uses: actions/cache/save@v3
with:
path: |
target/github-responses
key: ${{ steps.cache-github-restore.outputs.cache-primary-key }}
- name: Run post-conditions
run: test -f .github/actions.yml && eval "$(yq e '.post.ci // "true"' .github/actions.yml)" || true
- name: Automerge Scala Steward PRs
if: success() && github.event_name == 'pull_request' && contains(github.event.pull_request.body, 'Scala Steward')
uses: ridedott/[email protected]
with:
GITHUB_LOGIN: 47erbot
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/47degrees/.github
# If you want to suggest a change, please open a PR or issue in that repository

name: Update documentation

on:
release:
types: [published]
repository_dispatch:
types: [docs]

jobs:
documentation:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
ref: main
- name: Fetch tags
run: git fetch --tags
- name: Setup Scala
uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
- name: Setup github-changelog-generator
run: gem install github_changelog_generator -v 1.15.0
- name: Setup yq
run: sudo snap install yq
- name: Run pre-conditions
run: test -f .github/actions.yml && eval "$(yq e '.pre.docs // "true"' .github/actions.yml)" || true
- name: Generate documentation
run: sbt ci-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOWNLOAD_INFO_FROM_GITHUB: true
- name: Run post-conditions
run: test -f .github/actions.yml && eval "$(yq e '.post.docs // "true"' .github/actions.yml)" || true
- name: Push changes
uses: stefanzweifel/[email protected]
with:
commit_message: 'Update documentation, and other files [skip ci]'
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Drafts/updates the next repository release

on:
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/47degrees/.github
# If you want to suggest a change, please open a PR or issue in that repository

name: Release

on:
release:
types: [published]
push:
branches: main

jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags
- name: Setup Scala
uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
- name: Setup GPG
uses: olafurpg/setup-gpg@v3
- name: Setup yq
run: sudo snap install yq
- name: Run pre-conditions
run: test -f .github/actions.yml && eval "$(yq e '.pre.release // "true"' .github/actions.yml)" || true
- name: Release new version
run: sbt ci-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Run post-conditions
run: test -f .github/actions.yml && eval "$(yq e '.post.release // "true"' .github/actions.yml)" || true
79 changes: 79 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/47degrees/.github
# If you want to suggest a change, please open a PR or issue in that repository

### Intellij ###

.idea
out/

### Java ###

*.class
*.log

### macOS ###

.DS_Store

### SBT ###

dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/
.history
.cache
.lib/
.bsp

### Scala ###

*.metals
.bloop/
.metals/
metals.sbt
.scala-build/

### Vim ###

# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist

# Project local build artefacts
.output

# Auto-generated tag files
tags

# Persistent undo
[._]*.un~

# Coc configuration directory
.vim

### VisualStudioCode ###

.vscode/
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Direnv

.direnv
35 changes: 35 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# tune this file as appropriate to your style! see: https://olafurpg.github.io/scalafmt/#Configuration

version = "3.7.4"

maxColumn = 150

continuationIndent.callSite = 2

runner {
dialect = scala3
}

newlines {
sometimesBeforeColonInMethodReturnType = false
}

align {
arrowEnumeratorGenerator = false
ifWhileOpenParen = false
openParenCallSite = false
openParenDefnSite = false

tokens = ["%", "%%"]
}

docstrings.style = Asterisk

rewrite {
rules = [SortImports, RedundantBraces]
redundantBraces.maxLines = 1
}

optIn {
breaksInsideChains = true
}
17 changes: 17 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[comment]: <> (Don't edit this file!)
[comment]: <> (It is automatically updated after every release of https://github.com/47degrees/.github)
[comment]: <> (If you want to suggest a change, please open a PR or issue in that repository)

# Authors

## Maintainers

The maintainers of the project are:

- [![fedefernandez](https://avatars.githubusercontent.com/u/720923?v=4&s=20) **Fede Fernández (fedefernandez)**](https://github.com/fedefernandez)

## Contributors

These are the people that have contributed to the _karat-scalacheck_ project:

- [![fedefernandez](https://avatars.githubusercontent.com/u/720923?v=4&s=20) **fedefernandez**](https://github.com/fedefernandez)
Loading

0 comments on commit df3ff53

Please sign in to comment.