From ba9c4b3c5b47f3879c0d2555cc3669d67b79faab Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 20 Nov 2023 14:38:31 +0800 Subject: [PATCH] Add a CI workflow. --- .github/workflows/ci.yaml | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..8bd8648 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,63 @@ +name: CI +on: + pull_request: + +env: + FORCE_COLOR: "1" + +defaults: + run: + shell: bash + +# Cancel active CI runs for a PR before starting another run +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: macOS-latest + strategy: + matrix: + # target: ['macOS', 'iOS', 'tvOS', 'watchOS'] + target: ['macOS'] + include: + - briefcase-run-args: + + # - target: iOS + # briefcase-run-args: ' -d "iPhone SE (3rd generation)"' + steps: + - uses: actions/checkout@v4 + + - name: Extract config variables + id: config-vars + run: | + PYTHON_VER=$(make config | grep "PYTHON_VER=" | cut -d "=" -f 2) + echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT} + + - name: Set up Python + uses: actions/setup-python@v4.7.1 + with: + # Appending -dev ensures that we can always build the dev release. + # It's a no-op for versions that have been published. + python-version: ${{ steps.config-vars.outputs.PYTHON_VER }}-dev + + - name: Build ${{ matrix.target }} + run: | + # Do the build for the requested target. + make ${{ matrix.target }} + + - uses: actions/checkout@v4 + with: + repository: beeware/Python-support-testbed + path: Python-support-testbed + # ref: + + - name: Install dependencies + run: | + # Use the development version of Briefcase + python -m pip install git+https://github.com/beeware/briefcase.git + + - name: Run support testbed check + working-directory: Python-support-testbed + run: briefcase run ${{ matrix.target }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ steps.config-vars.outputs.PYTHON_VER }}-${{ matrix.target }}-support.custom.tar.gz\'