2025-01-10T15:36:21Z #3702
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
# TODO: | |
# - https://docs.docker.com/build/cache/backends/inline/ | |
# - https://stackoverflow.com/a/73750495 | |
name: Ci | |
permissions: | |
contents: read | |
checks: write | |
on: | |
push: | |
branches: | |
- 'master' | |
env: | |
IMAGE_NAME: 'omlish-ci' | |
jobs: | |
test: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: 'actions/[email protected]' | |
- uses: 'styfle/[email protected]' | |
with: | |
access_token: '${{ github.token }}' | |
## | |
# - name: 'Cache' | |
# uses: 'actions/cache@v2' | |
# id: 'cache' | |
# with: | |
# path: '~/.cache' | |
# key: | |
# ci-${{ github.ref }}-${{ hashFiles( | |
# 'docker/.timestamp', | |
# 'docker/ci/Dockerfile', | |
# 'docker/compose.yml' | |
# ) }} | |
# restore-keys: | | |
# ci-${{ github.ref }}- | |
# ci- | |
# - name: 'Docker cache load' | |
# run: > | |
# tar -tvf ~/.cache/docker/ci.tar ||: ; | |
# docker load -i ~/.cache/docker/ci.tar ||: ; | |
## | |
# - uses: 'mxschmitt/[email protected]' | |
- name: 'Build CI image' | |
run: > | |
make ci-image | |
- name: 'Run CI tests' | |
run: > | |
CI_DOCKER_OPTS='-v ${{ github.workspace }}:/github/workspace -e PYTEST_JUNIT_XML_PATH' | |
PYTEST_JUNIT_XML_PATH=/github/workspace/test-results.xml | |
make ci | |
- uses: 'mikepenz/[email protected]' | |
if: 'always()' | |
with: | |
report_paths: ${{ github.workspace }}/test-results.xml | |
## | |
# - name: 'Docker cache save' | |
# if: "steps.cache.outputs.cache-hit != 'true'" | |
# run: > | |
# docker images -a && | |
# mkdir -p ~/.cache/docker/ && | |
# ( | |
# for IMG in $( | |
# egrep '^\s*image:' docker/compose.yml | cut -d"'" -f2 | egrep -v 'wrmsr/omlish-ci' | |
# ) ; do | |
# if ( docker history "$IMG" >/dev/null 2>/dev/null ) ; then | |
# echo "$IMG" ; | |
# docker history "$IMG" | tail -n+2 | awk '{print $1}' | egrep -v '<missing>' ; | |
# fi ; | |
# done | |
# ) | xargs docker save -o ~/.cache/docker/ci.tar |