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

ci: streamline the build and test process #51

Draft
wants to merge 78 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
4398c36
ci: prepare for conventional commit automation
bassco Nov 4, 2023
a1071e8
ci(docker): introduce new automation process
bassco Nov 4, 2023
96b3648
ci: add docker metadata labels
bassco Nov 4, 2023
6afaf6f
ci: only push images on release
bassco Nov 4, 2023
e0ba9e4
Configure Renovate (#24)
renovate[bot] Nov 4, 2023
f844a36
fix(deps): update rust crate futures to 0.3.29
renovate[bot] Nov 4, 2023
24bb51d
fix(deps): update rust crate log to 0.4.20
renovate[bot] Nov 5, 2023
a4cb1e5
fix(deps): update rust crate serde_json to 1.0.108
renovate[bot] Nov 5, 2023
cc39a54
fix(deps): update serde monorepo to 1.0.190
renovate[bot] Nov 5, 2023
feabb69
chore(deps): update alpine docker tag to v3.18.4
renovate[bot] Nov 5, 2023
021b8a9
chore(deps): update rust docker tag to v1.73.0
renovate[bot] Nov 5, 2023
7c45d8f
fix(deps): update rust crate env_logger to 0.10.0
renovate[bot] Nov 5, 2023
b7c6d19
fix(deps): remove chrono (#29)
renovate[bot] Nov 5, 2023
c2534db
fix(deps): update rust crate num_cpus to 1.16.0 (#42)
renovate[bot] Nov 5, 2023
5f24dce
fix(deps): bump num-bigint from 0.4.2 to 0.4.3 (#18)
dependabot[bot] Nov 5, 2023
fdd8003
fix(security): bump regex from 1.5.4 to 1.5.6 (#20)
dependabot[bot] Nov 5, 2023
1aad18c
fix(deps): update rust crate config to 0.13.3 (#37)
renovate[bot] Nov 5, 2023
47580fd
fix(deps): update rust crate prometheus to 0.13.3
renovate[bot] Nov 5, 2023
dbaa828
fix(deps): update rust crate hyper to 0.14.27 (#39)
renovate[bot] Nov 5, 2023
267c8fa
chore(deps): update rust crate pkg-config to 0.3.27
renovate[bot] Nov 5, 2023
696d44a
chore(deps): update actions/checkout action to v4 (#45)
renovate[bot] Nov 5, 2023
1005399
chore: enhance renovate config
bassco Nov 5, 2023
abc3199
ci(docker): introduce new automation process
bassco Nov 4, 2023
8e0a1c6
ci(actions): bump checkout to v4
bassco Nov 6, 2023
f90232e
build(docker): reduce layers and dry the versions
bassco Nov 6, 2023
c474b2c
ci: only publish changelog
bassco Nov 6, 2023
86ab90b
chore: cleam up the ignore files
bassco Nov 6, 2023
6da08a4
ci: enable docker preview images and enable releases
bassco Nov 6, 2023
44bdac4
chore: add code formatters
bassco Nov 6, 2023
c320069
ci: fix workflow error and message
bassco Nov 6, 2023
ed38ce8
Merge branch 'master' into improvements
bassco Nov 6, 2023
1396813
build: revert docker arg
bassco Nov 6, 2023
975afda
ci: enable pushing pr images to the package registry
bassco Nov 6, 2023
b4d53eb
ci: enable dry-run of the semantic release process
bassco Nov 6, 2023
0e05ccc
ci: create container images when a github release is published
bassco Nov 6, 2023
ec9e9f0
chore: revert make commands and use branch image
bassco Nov 6, 2023
a316d4b
ci(container): add latest tag when creating images
bassco Nov 6, 2023
4e04e16
ci(workflow): only create branch image if the tests pass
bassco Nov 6, 2023
6beb9ab
ci(workflow): change branch image tag source to ref_name
bassco Nov 6, 2023
ddfa45a
test: debug the git references for the docker pr tags
bassco Nov 6, 2023
c57c127
ci(workflow): change branch image tag source to head_ref
bassco Nov 6, 2023
267548a
test: add notes and configuration for local testing
bassco Nov 6, 2023
dd0102e
chore: format the config json files
bassco Nov 6, 2023
57a99e9
test: set explicit env var as it is expected
bassco Nov 6, 2023
91e82ad
ci(container): use artifacts for the preview container image
bassco Nov 6, 2023
09c7668
ci(rust): cache and compile optimisations
bassco Nov 6, 2023
d60a0cf
fix(rust): remove redundant clone compile warning
bassco Nov 6, 2023
8a52cdb
ci(rust): add rustflags compile step
bassco Nov 6, 2023
852f09e
ci: debug artifact location for preview image
bassco Nov 6, 2023
7f4b7f9
ci: download artifact after checkout for preview image
bassco Nov 6, 2023
75f3b06
ci: use absolute path for preview artifact
bassco Nov 6, 2023
20f04f5
ci(preview): add buildx action to preview
bassco Nov 6, 2023
b529335
ci(preview): allow build binary to be added to build context
bassco Nov 6, 2023
8497c55
ci(preview): fix registry address and username
bassco Nov 7, 2023
c50016a
ci(preview): github token is used for login
bassco Nov 7, 2023
4916435
revert: "ci(preview): github token is used for login"
bassco Nov 7, 2023
b989041
ci: set artifact retention to a day
bassco Nov 7, 2023
ec9c7d3
ci(preview): remove images and artifacts when pr closed
bassco Nov 7, 2023
0c3944f
ci: pull the latest preview image on compose up
bassco Nov 7, 2023
a8336cf
ci: add cache clean up from closed prs
bassco Nov 7, 2023
c3c04c9
Merge branch 'master' into improvements
bassco Nov 7, 2023
49db44b
chore(docker): explicitly set build context files
bassco Nov 9, 2023
ec42397
style(editor): update definitions
bassco Nov 9, 2023
19edf62
chore(cleanup): fix filename reference
bassco Nov 9, 2023
fbfd9ee
chore(workflow): rename pr title feedback linter
bassco Nov 9, 2023
6837dfc
chore(workflow): rename pr tests and image preview
bassco Nov 9, 2023
562e6d2
chore(workflow): remove duplicate title linter
bassco Nov 9, 2023
ca82083
ci(docker): add latest and master tags
bassco Nov 9, 2023
f2e2804
ci(community): inform and close stale issues
bassco Nov 9, 2023
1b2145d
docs(releases): update release note formatting
bassco Nov 9, 2023
3937a6f
docs(release): label conventional pr titles
bassco Nov 9, 2023
c1ce36f
docs(release): change issue and pr note to reference to container image
bassco Nov 9, 2023
bb8b664
fix(benchmarks): add criterion benchmark abilities
bassco Nov 11, 2023
033ac64
docs(benchmarking): add notes and config
bassco Nov 11, 2023
566e573
fix(benchmaark): parameter name and report location""
bassco Nov 11, 2023
a9fa8a0
fix(features): rework features so that we can test awc_client
bassco Nov 12, 2023
43e1009
Merge branch 'master' into improvements
bassco Nov 12, 2023
61b68e7
fix(awc_client): increase payload size to 1mb default and 4mb in config
bassco Nov 15, 2023
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
9 changes: 5 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target
.git
.github
.gitignore
**

!target/release/dali
!LICENSE
!README.md
36 changes: 36 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
bassco marked this conversation as resolved.
Show resolved Hide resolved

[Dockerfile]
indent_size = 4

[Dockerfile.preview]
indent_size = 4

[Dockerfile]
indent_size = 4

[*.rs]
indent_size = 4
max_line_length = 100

[*.md]
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HTTP_HOST=backend
12 changes: 12 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export HTTP_HOST=backend:80
export BENCH_HTTP_HOST="http://127.0.0.1:8080" # dali default port from config/common.json
export BENCH_FILE_SERVER_HOST="http://127.0.0.1:9000" # nginx exposed port
export CARGO_INCREMENTAL=0
export CARGO_NET_RETRY=10
export CI=1
export RUST_BACKTRACE=short
export RUSTFLAGS_EXTRA="-D warnings -W rust-2021-compatibility"
export RUSTUP_MAX_RETRIES=10

# export RUSTFLAGS_EXTRA="-D warnings -W unreachable-pub -W rust-2021-compatibility"
export RUSTFLAGS="$RUSTFLAGS_EXTRA -C target-feature=-crt-static $(pkg-config vips --libs)"
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
45 changes: 28 additions & 17 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
name-template: 'Upcoming v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
- title: ":boom: Breaking Changes"
label: "breaking"
- title: ":rocket: Features"
label: "enhancement"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":beetle: Fixes"
label: "bug"
- title: ":racehorse: Performance"
label: "performance"
- title: ":rotating_light: Testing"
label: "tests"
- title: ":construction_worker: Continuous Integration"
labels:
- 'feat'
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
- "ci"
- "github"
- "github_actions"
- title: ":books: Documentation"
label: "documentation"
- title: ":hammer: Refactoring"
label: "refactoring"
- title: ":lipstick: Style"
label: "style"
- title: ":scroll: Policy"
label: "policy"
- title: ":package: Dependencies"
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'dependencies'
- title: '🧰 Maintenance'
label: 'chore'
- title: '📖 Documentation'
labels:
- 'docs'
- title: '🔧 Renovate'
labels:
- 'renovate'
- "dependencies"
- "renovate"
- "dependabot"
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
Expand Down
51 changes: 51 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
# https://github.com/bcoe/conventional-release-labels
# https://dev.to/github/how-to-automatically-generate-release-notes-for-your-project-2ng8
# https://www.conventionalcommits.org/en/v1.0.0/
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: ♻️Enhancement
labels:
- refactor
- enhancement
- title: 🚀 Features
labels:
- feature
- enhancement
- title: 🐛 Bug Fixes
labels:
- fix
- bug
- title: ⚠️ Changes
labels:
- changed
- title: ⛔️ Deprecated
labels:
- deprecated
- title: 🗑 Removed
labels:
- removed
- title: 🔐 Security
labels:
- security
- dependabot
- title: 📄 Documentation
labels:
- docs
- documentation
- title: 🧩 Dependency Updates
labels:
- deps
- dependencies
- renovate
- title: 🧰 Maintenance
label: 'chore'
- title: 🧺 Miscellaneous
label: misc
- title: Other Changes
labels:
- "*"
ignored_types: []
9 changes: 9 additions & 0 deletions .github/workflows/conventional-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
on:
pull_request:
types: [ opened, edited ]
name: conventional-release-labels
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: bcoe/conventional-release-labels@v1
45 changes: 45 additions & 0 deletions .github/workflows/lint-pr-title-with-feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# (c) Copyright 2019-2023 OLX

# Attribution: https://github.com/amannn/action-semantic-pull-request/blob/v5.3.0/.github/workflows/lint-pr-title-preview-outputErrorMessage.yml
name: "Lint PR title preview with feedback"
on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: write # needed to write comment to PR

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
56 changes: 56 additions & 0 deletions .github/workflows/pr-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Delete Docker images after PR merge
#

name: 'Clean Up PR'

on:
pull_request:
types: [closed]
workflow_dispatch:

jobs:
purge:
name: Delete build artifacts and preview images
runs-on: ubuntu-latest
steps:
- uses: chipkent/action-cleanup-package@v1.0.1
with:
package-name: ${{ github.event.repository.name }}/dali
tag: ${{ github.head_ref }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: stefanluptak/delete-old-pr-artifacts@v1
with:
workflow_filename: pull-requests-tests.yml
debug: true
cleanup:
name: Clean up branch caches
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache

REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading