From 183c2e48899d294a06f5d295a4d0071ebea581de Mon Sep 17 00:00:00 2001 From: Luke Craig Date: Tue, 14 Jan 2025 11:27:37 -0500 Subject: [PATCH] add workflows --- .github/workflows/parallel_tests.yml | 30 ++++++++++++++++++++ .github/workflows/publish_docker.yml | 42 ++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/parallel_tests.yml create mode 100644 .github/workflows/publish_docker.yml diff --git a/.github/workflows/parallel_tests.yml b/.github/workflows/parallel_tests.yml new file mode 100644 index 000000000000..010e6b7cbb2a --- /dev/null +++ b/.github/workflows/parallel_tests.yml @@ -0,0 +1,30 @@ +name: Parallel Tests +# For PRs to dev or pushes that modify the root Dockerfile, build from scratch +# then run CI tests using that container in parallel +# For forked repos that can't use our panda-arc test suite, just build and run make check +on: + # Allow to repo owner to manually run this workflow for external PRs once code is vetted + workflow_dispatch: + + # Run automatically for internal PRs and pushes + pull_request: + branches: + - main + +jobs: + build_container: + if: github.repository == 'panda-re/qemu' + runs-on: ubuntu-latest + steps: + # - name: Install git + # run: sudo apt-get -qq update -y && sudo apt-get -qq install git -y + - uses: actions/checkout@v4 # Clones to $GITHUB_WORKSPACE. NOTE: this requires git > 2.18 (not on ubuntu 18.04 by default) to get .git directory + with: + fetch-depth: 0 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build + uses: docker/build-push-action@v5 + with: + context: ${{ github.workspace }} + push: false \ No newline at end of file diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml new file mode 100644 index 000000000000..e60cf3716551 --- /dev/null +++ b/.github/workflows/publish_docker.yml @@ -0,0 +1,42 @@ +name: Build and Publish Docker Container and Pypanda Docs # Only for main panda-re repo, not forks + +on: + push: + branches: + - main + +jobs: + build_release_assets: + if: github.repository == 'panda-re/qemu' && github.ref == 'refs/heads/dev' + runs-on: panda-arc + steps: + - name: Install git + run: sudo apt-get -qq update -y && sudo apt-get -qq install git curl jq -y + + - name: Check out + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get next version + uses: reecetech/version-increment@2023.10.2 + id: version + with: + release_branch: dev + use_api: true + + - name: 'Login to Docker Registry' + uses: docker/login-action@v3 + with: + username: pandare + password: ${{secrets.pandare_dockerhub}} + + - name: Build panda:latest + uses: docker/build-push-action@v5 + with: + push: true + context: ${{ github.workspace }} + tags: | + pandare/panda-ng:${{ github.sha }} + pandare/panda-ng:${{ steps.version.outputs.v-version }} + pandare/panda-ng:latest \ No newline at end of file