2022-04-23 05:33:54 +00:00
|
|
|
name: CI
|
|
|
|
|
2022-04-28 02:23:33 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
2022-04-23 05:33:54 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-04-25 05:33:39 +00:00
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
platform: x64
|
|
|
|
prefix: lnx
|
|
|
|
- os: macos-latest
|
|
|
|
platform: x64
|
|
|
|
prefix: osx
|
|
|
|
- os: windows-latest
|
|
|
|
platform: x64
|
|
|
|
prefix: win
|
|
|
|
- os: windows-latest
|
|
|
|
platform: x86
|
|
|
|
prefix: win
|
2022-04-23 05:33:54 +00:00
|
|
|
|
2022-04-25 05:33:39 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-04-23 05:33:54 +00:00
|
|
|
|
|
|
|
env:
|
2022-04-25 05:33:39 +00:00
|
|
|
PLATFORM: ${{ matrix.platform }}
|
|
|
|
|
2022-04-23 05:33:54 +00:00
|
|
|
steps:
|
2022-04-24 03:39:09 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-04-25 05:33:39 +00:00
|
|
|
|
2022-04-27 22:55:16 +00:00
|
|
|
# A deploy key is setup so that the potential push of ./internal/source can
|
|
|
|
# trigger a new build. Care is taken to make sure loops cannot happen.
|
|
|
|
- uses: webfactory/ssh-agent@v0.5.4
|
2022-04-28 02:23:33 +00:00
|
|
|
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }}
|
2022-04-27 22:55:16 +00:00
|
|
|
with:
|
|
|
|
ssh-private-key: ${{ secrets.ACTION_DEPLOY_KEY }}
|
|
|
|
|
2022-04-25 05:33:39 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
2022-04-25 14:27:20 +00:00
|
|
|
run: sudo apt update && sudo apt install build-essential x11-utils mesa-common-dev libglu1-mesa-dev libasound2-dev zlib1g-dev
|
2022-04-25 05:33:39 +00:00
|
|
|
|
2022-04-24 03:39:09 +00:00
|
|
|
- name: Calculate Version
|
|
|
|
shell: bash
|
|
|
|
run: .ci/calculate_version.sh
|
2022-04-25 05:33:39 +00:00
|
|
|
|
|
|
|
- name: Bootstrap compiler Linux/OSX
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
|
|
|
|
run: .ci/bootstrap.sh ${{ matrix.prefix }}
|
|
|
|
|
|
|
|
- name: Bootstrap compiler Windows
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
2022-04-23 05:33:54 +00:00
|
|
|
run: .ci/bootstrap.bat
|
2022-04-25 05:33:39 +00:00
|
|
|
|
|
|
|
- name: Compile Linux/OSX
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
|
|
|
|
run: .ci/compile.sh
|
|
|
|
|
|
|
|
- name: Compile Windows
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
2022-04-23 05:33:54 +00:00
|
|
|
run: .ci/compile.bat
|
2022-04-25 05:33:39 +00:00
|
|
|
|
2022-04-24 03:39:09 +00:00
|
|
|
- name: Print QB64 Version
|
|
|
|
run: ./qb64 -?
|
2022-04-23 05:33:54 +00:00
|
|
|
|
2022-04-28 23:34:11 +00:00
|
|
|
- name: Test
|
|
|
|
shell: bash
|
|
|
|
run: tests/run_tests.sh
|
|
|
|
|
2022-04-25 05:33:39 +00:00
|
|
|
- name: Create QB64 Artifact
|
2022-04-24 03:39:09 +00:00
|
|
|
shell: bash
|
2022-04-26 22:11:10 +00:00
|
|
|
run: .ci/make-dist.sh ${{ matrix.os }}
|
2022-04-25 05:33:39 +00:00
|
|
|
|
2022-04-27 05:11:02 +00:00
|
|
|
# Note that compiling programs in dist does modify the ./dist and make it
|
|
|
|
# dirty, but that's ok because we've already create the .7z or .tar.gz
|
|
|
|
# artifacts in the previous step
|
|
|
|
- name: Test QB64 Artifact
|
|
|
|
shell: bash
|
|
|
|
run: tests/run_dist_tests.sh ./dist/qb64 ${{ matrix.prefix }}
|
|
|
|
|
2022-04-27 22:55:16 +00:00
|
|
|
# Only update ./internal/source if we're building on Linux, building on
|
|
|
|
# the main branch, and building a Pull request merge. Otherwise the repo
|
|
|
|
# is left alone.
|
|
|
|
- name: Update ./internal/source
|
|
|
|
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'Merge pull request') }}
|
|
|
|
run: .ci/push-internal-source.sh
|
|
|
|
|
2022-04-25 04:53:10 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-04-27 05:11:02 +00:00
|
|
|
if: always()
|
2022-04-25 04:53:10 +00:00
|
|
|
with:
|
2022-04-25 05:33:39 +00:00
|
|
|
name: qb64-${{ matrix.prefix }}-${{ matrix.platform }}
|
|
|
|
path: |
|
2022-04-28 23:34:11 +00:00
|
|
|
tests/results/
|
2022-04-25 05:33:39 +00:00
|
|
|
qb64_win-x86.7z
|
|
|
|
qb64_win-x64.7z
|
|
|
|
qb64_lnx.tar.gz
|
|
|
|
qb64_osx.tar.gz
|
2022-04-25 21:57:13 +00:00
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
draft: true
|
|
|
|
files: |
|
|
|
|
qb64_win-x86.7z
|
|
|
|
qb64_win-x64.7z
|
|
|
|
qb64_lnx.tar.gz
|
|
|
|
qb64_osx.tar.gz
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|