-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #646 from MaMpf-HD/dev
- Loading branch information
Showing
86 changed files
with
2,090 additions
and
1,830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore test files themselves in the Codecov report | ||
# see: https://about.codecov.io/blog/should-i-include-test-files-in-code-coverage-calculations/ | ||
ignore: | ||
- "spec/" | ||
- "*_spec.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"target": { | ||
"mampf": { | ||
"cache-from": [ | ||
"type=registry,ref=ghcr.io/mampf-hd/mampf:cache" | ||
], | ||
"cache-to": [ | ||
"type=registry,ref=ghcr.io/mampf-hd/mampf:cache" | ||
], | ||
"output": [ | ||
"type=docker" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
- experimental | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
jobs: | ||
# For the setup idea using Docker Buildx, see StackOverflow answer [1]. | ||
# [2] and [3] might also be very useful. [4] is generally about Docker | ||
# cache management within GitHub Actions. | ||
# | ||
# [1] https://stackoverflow.com/a/75544124/ | ||
# [2] https://depot.dev/blog/docker-layer-caching-in-github-actions#docker-layer-caching-in-github-actions | ||
# [3] https://www.deploysentinel.com/blog/docker-buildx-cache-with-github-actions | ||
# [4] https://docs.docker.com/build/ci/github-actions/cache/ | ||
unit-tests: | ||
name: Unit tests | ||
environment: testing | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# see https://github.com/orgs/MaMpf-HD/packages?repo_name=mampf | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build docker images | ||
# As the docker-compose.yml file uses contexts like "./../..", we have | ||
# to change the working directory here. | ||
working-directory: docker/test | ||
run: | | ||
docker buildx bake --file ./docker-compose.yml --file ./../../.github/workflows/docker-compose-cache.json | ||
- name: Run unit tests | ||
working-directory: docker/test | ||
run: | | ||
docker compose run --entrypoint="" mampf sh -c "RAILS_ENV=test bundle exec rspec --format RSpec::Github::Formatter" | ||
- name: Report test coverage to codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./coverage/coverage.xml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
codecov_yml_path: ./config/codecov.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.