Skip to content

Remove need for download token to prep for release #1217

Remove need for download token to prep for release

Remove need for download token to prep for release #1217

Workflow file for this run

name: Test and Release Container
on:
pull_request:
branches:
- main
jobs:
lint:
runs-on: rehosting-arc
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
- name: Set up Python
if: github.event_name == 'pull_request'
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
if: github.event_name == 'pull_request'
run: pip install flake8 lintly markupsafe==2.0.1
- name: Lint with flake8
if: github.event_name == 'pull_request'
run: flake8 | lintly
env:
LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }}
build_container:
runs-on: rehosting-arc
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
# (required)
permissions:
contents: write
packages: write
needs: lint
steps:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: rehosting
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Install dependencies and label git workspace safe
run: |
sudo apt-get update
sudo apt-get -y install python3-pip git curl jq gzip tmux
python3 -m pip install click
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image and push to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: rehosting/penguin:${{ github.sha }}
cache-from: |
type=registry,ref=rehosting/penguin:latest,mode=max
type=registry,ref=rehosting/penguin:cache-PR-${{github.event.number}},mode=max
cache-to: type=registry,ref=rehosting/penguin:cache-PR-${{ github.event.number }}
run_tests:
needs: build_container
runs-on: rehosting-arc
strategy:
fail-fast: false
matrix:
kernel: ["4.10"]
arch: ["armel", "mipsel", "mipseb", "mips64el", "mips64eb", "aarch64", "x86_64"]
steps:
- name: Install dependencies and label git workspace safe
run: |
sudo apt-get update && sudo apt-get -y install python3-pip git curl gzip tmux
python3 -m pip install click pyyaml
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: rehosting
password: ${{secrets.DOCKERHUB_TOKEN}}
# Locally tag as latest, just for testing
- name: Pull the image from Dockerhub
run: |
docker pull rehosting/penguin:${{ github.sha }};
docker tag rehosting/penguin:${{ github.sha }} rehosting/penguin:latest
- name: Basic test for ${{ matrix.arch }}
run: timeout 10m python3 $GITHUB_WORKSPACE/tests/unit_tests/basic_target/test.py --arch ${{ matrix.arch }}
- name: Test for ${{ matrix.arch }} kernel v${{ matrix.kernel }}
run: timeout 10m python3 $GITHUB_WORKSPACE/tests/unit_tests/test_target/test.py --kernel ${{ matrix.kernel }} --arch ${{ matrix.arch }}
- name: Find the results
id: results
run: |
verifier=$(realpath $GITHUB_WORKSPACE/tests/unit_tests/test_target/results/latest/verifier.xml)
echo "Found verifier xml at $verifier"
echo "output_verifier=${verifier}" >> "$GITHUB_OUTPUT"
- name: Test Report
uses: dorny/test-reporter@v1.9.1
if: success() || failure()
with:
name: ${{ matrix.arch }}-test-results
path: ${{ steps.results.outputs.output_verifier}}
reporter: java-junit
- name: Get artifact path
id: artifact
if: failure()
run: |
artifact_path=$(realpath $GITHUB_WORKSPACE/tests/unit_tests/test_target/results/latest/)
echo "artifact_path=${artifact_path}/*" >> "$GITHUB_OUTPUT"
- name: Debug info
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}-artifacts
path: ${{ steps.artifact.outputs.artifact_path }}