-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* optimize check for installed packages (apt, pip) * fix jukebox_dir * remove package optimization from dockerfile add comments in package step * add package installation from file test reads the same file. only one place to maintain * install internal packages in Dockerfile dont install resolvconf as it will fail in containers * added textfile for arm sepcific packages * removed as already part of install script * add package textfile for autohotspot setup * correct variable usage. * check homedir as prerequisite * some fixes * read modules to test from file * renamed package txt for raspberry pi specifics * update sed call * renamed local variable * save images as artifact * clarify function name. add function comment * fixed mpd service enablement * fix unnecessary rebuild of unrelated package files
- Loading branch information
1 parent
0457616
commit f610e5e
Showing
14 changed files
with
211 additions
and
104 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 |
---|---|---|
|
@@ -43,7 +43,7 @@ jobs: | |
|
||
outputs: | ||
cache_key: ${{ steps.vars.outputs.cache_key }} | ||
image_file_path: ${{ steps.vars.outputs.image_file_path }} | ||
image_file_name: ${{ steps.vars.outputs.image_file_name }} | ||
image_tag_name: ${{ steps.vars.outputs.image_tag_name }} | ||
|
||
# create local docker registry to use locally build images | ||
|
@@ -73,18 +73,18 @@ jobs: | |
CACHE_SCOPE: ${{ inputs.cache_scope }} | ||
run: | | ||
echo "image_tag_name=${{ env.DOCKER_IMAGE_NAME }}:${{ env.DEBIAN_CODENAME }}-test" >> $GITHUB_OUTPUT | ||
echo "image_file_name=${{ env.DOCKER_IMAGE_NAME }}-${{ env.DEBIAN_CODENAME }}.tar" >> $GITHUB_OUTPUT | ||
echo "cache_scope=${{ env.CACHE_SCOPE }}-${{ env.DEBIAN_CODENAME }}" >> $GITHUB_OUTPUT | ||
- name: Set Output vars | ||
id: vars | ||
env: | ||
DEBIAN_CODENAME: ${{ inputs.debian_codename }} | ||
DOCKER_IMAGE_NAME: ${{ inputs.docker_image_name }} | ||
LOCAL_REGISTRY_PORT: ${{ inputs.local_registry_port }} | ||
run: | | ||
echo "image_tag_name=${{ steps.pre-vars.outputs.image_tag_name }}" >> $GITHUB_OUTPUT | ||
echo "image_tag_name_local_base=localhost:${{ env.LOCAL_REGISTRY_PORT }}/${{ steps.pre-vars.outputs.image_tag_name }}-base" >> $GITHUB_OUTPUT | ||
echo "image_file_path=./${{ env.DOCKER_IMAGE_NAME }}-${{ env.DEBIAN_CODENAME }}.tar" >> $GITHUB_OUTPUT | ||
echo "image_file_name=${{ steps.pre-vars.outputs.image_file_name }}" >> $GITHUB_OUTPUT | ||
echo "image_file_path=./${{ steps.pre-vars.outputs.image_file_name }}" >> $GITHUB_OUTPUT | ||
echo "cache_scope=${{ steps.pre-vars.outputs.cache_scope }}" >> $GITHUB_OUTPUT | ||
echo "cache_key=${{ steps.pre-vars.outputs.cache_scope }}-${{ github.sha }}#${{ github.run_attempt }}" >> $GITHUB_OUTPUT | ||
|
@@ -123,12 +123,12 @@ jobs: | |
build-args: | | ||
BASE_TEST_IMAGE=${{ steps.vars.outputs.image_tag_name_local_base }} | ||
# Cache image file for next jobs | ||
- name: Cache Save Docker Image | ||
uses: actions/cache/save@v3 | ||
- name: Artifact Upload Docker Image | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
key: ${{ steps.vars.outputs.cache_key }} | ||
name: ${{ steps.vars.outputs.image_file_name }} | ||
path: ${{ steps.vars.outputs.image_file_path }} | ||
retention-days: 2 | ||
|
||
|
||
# Run tests with build image | ||
|
@@ -149,17 +149,14 @@ jobs: | |
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
# Load cached image file | ||
- name: Cache Restore Docker Image | ||
uses: actions/cache/restore@v3 | ||
- name: Artifact Download Docker Image | ||
uses: actions/download-artifact@v3 | ||
with: | ||
key: ${{ needs.build.outputs.cache_key }} | ||
path: ${{ needs.build.outputs.image_file_path }} | ||
fail-on-cache-miss: true | ||
name: ${{ needs.build.outputs.image_file_name }} | ||
|
||
- name: Load Docker Image | ||
run: | | ||
docker load --input ${{ needs.build.outputs.image_file_path }} | ||
docker load --input ${{ needs.build.outputs.image_file_name }} | ||
# Run test | ||
- name: Run Test ${{ inputs.debian_codename }}-${{ matrix.username }}-${{ matrix.test_script }} | ||
|
@@ -170,3 +167,16 @@ jobs: | |
name: ${{ matrix.test_script }} | ||
args: | | ||
./${{ matrix.test_script }} | ||
# cleanup after test execution | ||
cleanup: | ||
# run only if tests didn't fail: keep the artifact to make job reruns possible | ||
if: ${{ !failure() }} | ||
needs: [build, test] | ||
runs-on: ${{ inputs.runs_on }} | ||
|
||
steps: | ||
- name: Artifact Delete Docker Image | ||
uses: geekyeggo/delete-artifact@v2 | ||
with: | ||
name: ${{ needs.build.outputs.image_file_name }} |
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
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,6 @@ | ||
# Define packages for apt-get. These can be installed with | ||
# 'sed 's/#.*//g' packages.txt | xargs sudo apt-get install' | ||
|
||
dnsmasq | ||
hostapd | ||
iw |
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,4 @@ | ||
# Define packages for apt-get. These can be installed with | ||
# 'sed 's/#.*//g' packages.txt | xargs sudo apt-get install' | ||
|
||
raspberrypi-kernel-headers |
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,13 @@ | ||
# Define packages for apt-get. These can be installed with | ||
# 'sed 's/#.*//g' packages.txt | xargs sudo apt-get install' | ||
|
||
libspotify-dev | ||
libspotify12 | ||
python3-cffi | ||
python3-ply | ||
python3-pycparser | ||
python3-spotify | ||
mopidy | ||
mopidy-mpd | ||
mopidy-local | ||
mopidy-spotify |
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,30 @@ | ||
# Define packages for apt-get. These can be installed with | ||
# 'sed 's/#.*//g' packages.txt | xargs sudo apt-get install' | ||
|
||
samba | ||
samba-common-bin | ||
gcc | ||
lighttpd | ||
php-common | ||
php-cgi | ||
php | ||
at | ||
mpd | ||
mpc | ||
mpg123 | ||
git | ||
ffmpeg | ||
resolvconf | ||
spi-tools | ||
netcat-traditional | ||
alsa-utils | ||
lsof | ||
procps | ||
python3 | ||
python3-dev | ||
python3-pip | ||
python3-setuptools | ||
python3-wheel | ||
python3-mutagen | ||
python3-gpiozero | ||
python3-spidev |
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.