Skip to content

Use docker/login-action to log in (#61) #149

Use docker/login-action to log in (#61)

Use docker/login-action to log in (#61) #149

Workflow file for this run

name: CI
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
ubuntu-version:
- 22.04
- 24.04
steps:
- uses: actions/checkout@v4
- run: make UBUNTU=${{ matrix.ubuntu-version }} update
- run: make UBUNTU=${{ matrix.ubuntu-version }} build
- name: Log in to docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
- run: make UBUNTU=${{ matrix.ubuntu-version }} push
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
build-arm:
name: Build ARM
runs-on: ubuntu-24.04-arm
strategy:
matrix:
debian-version:
- bookworm
steps:
- uses: actions/checkout@v4
- run: make DEBIAN=${{ matrix.debian-version }} update/arm
- run: make DEBIAN=${{ matrix.debian-version }} build/arm-base
- name: Log in to docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
- run: make UBUNTU=${{ matrix.debian-version }} push/arm-base
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
build-minimal:
name: Build Minimal
runs-on: ubuntu-latest
strategy:
matrix:
ubuntu-version:
- 22.04
- 24.04
steps:
- uses: actions/checkout@v4
- run: make UBUNTU=${{ matrix.ubuntu-version }} update
- run: make UBUNTU=${{ matrix.ubuntu-version }} build/minimal-cross
- name: Log in to docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
- run: make UBUNTU=${{ matrix.ubuntu-version }} push/minimal-cross
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
- run: make UBUNTU=${{ matrix.ubuntu-version }} save/minimal-cross
- name: Upload roborio cross base image
uses: actions/upload-artifact@v4
with:
name: roborio-${{ matrix.ubuntu-version }}
path: roborio.tar.zst
retention-days: 1
- name: Upload raspbian cross base image
uses: actions/upload-artifact@v4
with:
name: raspbian-${{ matrix.ubuntu-version }}
path: raspbian.tar.zst
retention-days: 1
- name: Upload systemcore cross base image
uses: actions/upload-artifact@v4
with:
name: systemcore-${{ matrix.ubuntu-version }}
path: systemcore.tar.zst
retention-days: 1
build-python:
name: Build Python Images
needs: [build-minimal]
runs-on: ubuntu-latest
strategy:
matrix:
type:
- raspbian
pyversion:
- py311
- py312
- py313
ubuntu-version:
- 22.04
- 24.04
include:
- type: roborio
pyversion: py313
ubuntu-version: 22.04
- type: systemcore
pyversion: py313
ubuntu-version: 24.04
steps:
- uses: actions/checkout@v4
- name: Download image
uses: actions/download-artifact@v4
with:
name: ${{ matrix.type }}-${{ matrix.ubuntu-version }}
path: img
- name: Load image
run: |
unzstd -c img/${{ matrix.type }}.tar.zst | docker load
rm img/${{ matrix.type }}.tar.zst
- name: Build image
run: make UBUNTU=${{ matrix.ubuntu-version }} build/cross-${{ matrix.type }}-${{ matrix.pyversion }}
- name: Log in to docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
- name: Upload image
run: make UBUNTU=${{ matrix.ubuntu-version }} push/cross-${{ matrix.type }}-${{ matrix.pyversion }}
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}