From db16660eda5db1ae925915179db000dd2313c0ae Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Thu, 8 Apr 2021 18:24:37 +0100 Subject: [PATCH 1/2] Test: Setup Github Actions --- .github/workflows/ci-build.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 23 +++-------------------- ci_build.sh | 5 +++++ ci_prereq.sh | 12 ++++++++++++ ci_test.sh | 7 +++++++ 5 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ci-build.yml create mode 100755 ci_build.sh create mode 100755 ci_prereq.sh create mode 100755 ci_test.sh diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..b9ebe40 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,28 @@ +name: Build +on: + pull_request: + types: + - opened + - edited + - ready_for_review + - reopened + - synchronize + push: + +jobs: + build: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: package install + run: ./ci_prereq.sh + + - name: build + run: ./ci_build.sh + + - name: test + run: ./ci_test.sh diff --git a/.travis.yml b/.travis.yml index 003cc2f..ce69be5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,36 +2,19 @@ language: c dist: focal -addons: - apt: - sources: - - sourceline: 'ppa:dosemu2/ppa' - - sourceline: 'ppa:jwt27/djgpp-toolchain' - packages: - - acl - - gcc-djgpp - - devscripts - - debhelper - update: true - git: depth: false #env: DOSEMU_QUIET=1 before_install: - - echo "before_install" - - make deb + - ./ci_prereq.sh install: - - echo "install" - - sudo dpkg -i ../comcom32*amd64.deb - - sudo apt-get install -qq -f dosemu2 fdpp + - ./ci_build.sh before_script: - echo "before_script" - - sudo setfacl -m u:${USER}:rw /dev/kvm script: - - echo "script" - - dosemu -td -E ver + - ./ci_test.sh diff --git a/ci_build.sh b/ci_build.sh new file mode 100755 index 0000000..734da9b --- /dev/null +++ b/ci_build.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +make deb diff --git a/ci_prereq.sh b/ci_prereq.sh new file mode 100755 index 0000000..7d89739 --- /dev/null +++ b/ci_prereq.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +sudo add-apt-repository ppa:dosemu2/ppa +sudo add-apt-repository ppa:jwt27/djgpp-toolchain + +sudo apt update -q + +sudo apt install -y \ + acl \ + gcc-djgpp \ + devscripts \ + debhelper diff --git a/ci_test.sh b/ci_test.sh new file mode 100755 index 0000000..fc3e659 --- /dev/null +++ b/ci_test.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +sudo dpkg -i ../comcom32*amd64.deb +sudo apt-get install -qq -f dosemu2 fdpp +dosemu -td -E ver From 536acae87d94323c900d2889bc2030262e566860 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Fri, 9 Apr 2021 12:06:17 +0100 Subject: [PATCH 2/2] Test: Add latest build deployment to gh-pages Uses Github Pages (only on this repository) to host the latest build. Any existing content is overwritten, so if anyone wants real Github Pages here, this mechanism will need to be rethought. --- .github/workflows/ci-build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b9ebe40..2aca061 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -26,3 +26,18 @@ jobs: - name: test run: ./ci_test.sh + + - name: pages + if: github.ref == 'refs/heads/master' + run: | + mkdir -p pub/files + zip --junk-paths pub/files/comcom32.zip comcom32.exe + echo 'Latest build' > pub/index.html + + - name: deploy + if: github.ref == 'refs/heads/master' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: pub