Skip to content

Display type error annotations. #398

Display type error annotations.

Display type error annotations. #398

Workflow file for this run

name: Build
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
- name: Unit Tests
run: cd src && python3 -m unittest discover -s test/unit
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
- name: Integration Tests
run: cd src && python3 -m unittest discover -s test/integration
system-quick-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
- name: System Quick Tests
run: cd src && python3 -m unittest discover -s test/system/quick -v
check-changes:
runs-on: ubuntu-latest
outputs:
NEW_RELEASE: ${{ steps.check-changes.outputs.NEW_RELEASE }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
- name: Check for changes
id: check-changes
run: |
set -euo pipefail
SKIP_COMMIT=true ./src/build.sh | sha256sum > latest.id
git fetch origin main
if ! git diff --exit-code \
--unified=0 \
--ignore-matching-lines='export COMMIT' \
origin/main -- latest.id
then
echo "New build detected." >> $GITHUB_STEP_SUMMARY
echo "NEW_RELEASE=yes" >> "$GITHUB_OUTPUT"
else
echo "Skipping build, no changes detected." >> $GITHUB_STEP_SUMMARY
echo "NEW_RELEASE=no" >> "$GITHUB_OUTPUT"
fi
system-slow-tests:
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.NEW_RELEASE == 'yes'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
- name: System Slow Tests
run: cd src && python3 -m unittest discover -s test/system/slow -v
build:
runs-on: ubuntu-latest
needs: [unit-tests, integration-tests, system-quick-tests, system-slow-tests, check-changes]
if: needs.check-changes.outputs.NEW_RELEASE == 'yes'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
- name: Build
run: |
set -euo pipefail
SKIP_COMMIT=true ./src/build.sh | sha256sum > latest.id
ZIP_FILE="$(pwd)/dont_download.zip" ./src/build.sh > dont_download.sh
- name: Build Test
run: ./.github/downloader_test.py distribution_mister $(pwd)/src/test/system/fixtures/small_db_install/small_db_1.json
env:
DOWNLOADER_SOURCE: ./dont_download.sh
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
latest.id
dont_download.zip
dont_download.sh
pc-launcher-test:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
python-cmd: python3
- os: windows-latest
python-cmd: python
- os: macos-latest
python-cmd: python
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: PC Launcher Build Test on ${{ matrix.os }}
run: ${{ matrix.python-cmd }} src/pc_launcher.py
env:
DEFAULT_DB_ID: distribution_mister
DEFAULT_DB_URL: ${{ github.workspace }}/src/test/system/fixtures/small_db_install/small_db_1.json
DEBUG: true
PC_LAUNCHER_NO_WAIT: '1'
DOWNLOADER_SOURCE: ${{ github.workspace }}/dont_download.zip
compile-release:
runs-on: ubuntu-latest
needs: pc-launcher-test
steps:
- run: echo "owner_lc=$(echo "${GITHUB_REPOSITORY_OWNER,,}")" >> "$GITHUB_OUTPUT"
id: vars
- uses: actions/checkout@v2
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
- uses: docker/setup-qemu-action@v2
with:
platforms: arm/v7
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Nuitka
uses: docker/build-push-action@v4
with:
context: .
file: src/Dockerfile.nuitka
platforms: linux/arm/v7
push: true
tags: ghcr.io/${{ steps.vars.outputs.owner_lc }}/arm32v7-nuitka:latest
cache-from: type=registry,ref=ghcr.io/${{ steps.vars.outputs.owner_lc }}/arm32v7-nuitka:cache
cache-to: type=registry,ref=ghcr.io/${{ steps.vars.outputs.owner_lc }}/arm32v7-nuitka:cache,mode=max
- name: Compile
run: ./src/compile.sh downloader_bin
env:
NUITKA_IMAGE: ghcr.io/${{ steps.vars.outputs.owner_lc }}/arm32v7-nuitka:latest
- name: Release
id: release
run: |
git config --global user.email "[email protected]"
git config --global user.name "The CI/CD Bot"
./.github/release.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}