Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: EDK2 Build and Test CI (Windows)

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
edk2-windows-build:
runs-on: windows-latest
timeout-minutes: 30

defaults:
run:
shell: pwsh

steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4

- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: 🔧 Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8 pytest

- name: 🧹 Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

- name: 🧪 Run Python Tests
run: |
pytest

- name: 🔨 Build BaseTools
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
cd BaseTools
nmake -f Makefile

- name: 🏗️ Run build.py (EDK2 firmware build)
run: |
# Set environment vars for the EDK2 build
$env:WORKSPACE = "${{ github.workspace }}"
$env:EDK_TOOLS_PATH = "$env:WORKSPACE\BaseTools"

# Optional: You may need to run edksetup.bat first
.\edksetup.bat Rebuild

# Then invoke build.py or platform build directly
python build.py

- name: 🧰 Upload Build Artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: UEFI-Build-Output
path: Build/

- name: 📦 Upload Test Results (optional)
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: ./tests/**/*.xml

- name: Download a Build Artifact
uses: actions/[email protected]
with:
# Name of the artifact to download. If unspecified, all artifacts for the run are downloaded.
name: # optional
# IDs of the artifacts to download, comma-separated. Either inputs `artifact-ids` or `name` can be used, but not both.
artifact-ids: # optional
# Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE
path: # optional
# A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified.
pattern: # optional
# When multiple artifacts are matched, this changes the behavior of the destination directories. If true, the downloaded artifacts will be in the same directory specified by path. If false, the downloaded artifacts will be extracted into individual named directories within the specified path.
merge-multiple: # optional, default is false
# The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a different workflow run. If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run.
github-token: # optional
# The repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will be downloaded from.
repository: # optional, default is ${{ github.repository }}
# The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts will be downloaded from.
run-id: # optional, default is ${{ github.run_id }}

- name: Rational Integration Tester GitHub Action
# You may pin to the exact commit or the version.
# uses: IBM/devopsauto-integrtest-actions@5096cad49a7c728d0de5931481f5567254c70a70
uses: IBM/devopsauto-integrtest-actions@v1
with:
# The fully qualified path to Rational Integration Tester project directory. This value will be ignored if parameterFile field is used.
projectDir:
# The name of the API test project. This value will be ignored if parameterFile field is used.
projectName:
# The API Test environment to use for this execution. This value will be ignored if parameterFile field is used.
environment:
# Semicolon separated list of tests/suites to run. This value will be ignored if parameterFile field is used.
tests:
# The fully qualified path to a parameter file that contains project, environment, and run arguments for one or more tests.
parameterFile: # optional
# Specify the folder to export the JUnit reports to.
junitDir: # optional
- name: Trigger Mobile Builds with Appflow
# You may pin to the exact commit or the version.
# uses: ionic-team/appflow-build@71a31db2d31237f18473cb3235fa7c27302136dc
uses: ionic-team/appflow-build@v1
with:
# A token used to authenticate with the Appflow Service.
token:
# The Appflow App ID to trigger the build for.
app-id:
# The platform to build for (Web, iOS, Android)
platform: # default is Web
# The type of build to perform. iOS - (ad-hoc, app-store, development, enterprise) Android - (debug, release)
build-type: # optional
# The build stack to use for the build (macOS - 2020.06, Linux - 2020.06, etc.)
build-stack: # optional
# The name of the signing certificate to use for the build.
certificate: # optional
# The name of the environment to use for the build.
environment: # optional
# The name of the native config to use for the build.
native-config: # optional
# A comma seperated list of destination names to trigger a deployment to on successful completion of build.
destinations: # optional
# If the platform is Web set this to [yes|no] to control whether a web preview is created for the build.
web-preview: # optional, default is no
# The filename to use for the IPA/APK (iOS, Android) defaults to {{workflow_name}}-{{run_id}}.[apk|ipa]
filename: # optional
# If this is set if any artifacts are created (APK/IPA) they will be uploaded as the name that is specified
upload-artifact: # optional
# Set this to determine the number of days to retain the uploaded artifact [1-90](defaults to 90).
artifact-retention-days: # optional, default is 90