dockcross/.github/workflows/main.yml

108 lines
3.7 KiB
YAML
Raw Normal View History

name: Dockcross CI
on:
push:
branches:
- 'master'
2021-05-07 17:24:40 +02:00
- 'dev'
2021-05-07 20:09:15 +02:00
paths-ignore:
- '**/README.md'
- '**/README.rst'
pull_request:
branches:
- '*'
2021-05-14 17:14:22 +02:00
schedule:
2021-05-15 10:43:21 +02:00
# - cron: '0 0 * * 0' # Every sunday at 00:00 https://crontab.guru/#0_7_*_*_1
- cron: '0 0 17 * *'
jobs:
base:
name: base
runs-on: ubuntu-20.04
steps:
2021-05-16 00:48:21 +02:00
- name: "checkout code"
2021-05-16 00:49:09 +02:00
uses: actions/checkout@v2.2.0
with:
submodules: 'recursive'
fetch-depth: 0
- name: build
run: make base
- name: test
run: make base.test
- name: archive base
run: |
mkdir -p cache
2021-05-14 17:14:22 +02:00
docker save -o ./cache/base.tar bensuperpc/base:latest
- name: save base
uses: actions/upload-artifact@v2
with:
name: cache
path: ./cache
retention-days: 1
2021-02-10 18:38:51 +01:00
- name: deploy
if: github.ref == 'refs/heads/master'
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
2021-05-14 17:14:22 +02:00
docker image push bensuperpc/base
image:
name: ${{ matrix.arch_name }}
needs: base
runs-on: ubuntu-20.04
strategy:
fail-fast: false
max-parallel: 6
# manylinux2014-aarch64 cc65 pvsneslib
matrix:
2021-05-14 22:59:44 +02:00
arch_name: [android-arm, android-arm64, android-x86, android-x86_64, web-wasm, linux-armv8, linux-armv8-musl, linux-armv8-rpi3, linux-armv8-rpi4, linux-armv5, linux-armv5-musl, linux-armv6-rpi1, linux-armv7-rpi2, linux-armv6-musl, linux-armv6-rpi-old, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-mips, linux-mips64, linux-mips64el-n64, linux-mipsel, linux-m68k, linux-ppc32, linux-ppc64, linux-s390x, linux-x64, linux-x64-clang, linux-x86, linux-riscv64, manylinux2014-x64, manylinux2014-x86, windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-shared-x64, windows-shared-x64-posix, windows-shared-x86]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: cache
path: ./cache
- name: load base
run: docker load -i ./cache/base.tar
- name: build
run: make ${{ matrix.arch_name }}
- name: test
run: make ${{ matrix.arch_name }}.test
- name: deploy
if: github.ref == 'refs/heads/master'
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
2021-05-14 17:14:22 +02:00
docker image push bensuperpc/${{ matrix.arch_name }}
2021-05-07 20:09:15 +02:00
- name: clean
2021-05-14 17:14:22 +02:00
run: docker image rm -f bensuperpc/${{ matrix.arch_name }}
2021-05-15 10:40:34 +02:00
image_full:
name: ${{ matrix.arch_name }}
2021-05-15 17:36:36 +02:00
if: always()
2021-05-15 10:40:34 +02:00
needs: image
runs-on: ubuntu-20.04
strategy:
fail-fast: false
max-parallel: 2
matrix:
arch_name: [linux-armv8-rpi4.full, linux-armv8-rpi3.full, linux-armv7-rpi2.full, linux-armv7.full, linux-armv7a.full, linux-armv6-rpi1.full, linux-armv8.full]
2021-05-15 10:40:34 +02:00
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: cache
path: ./cache
- name: load base
run: docker load -i ./cache/base.tar
# - name: load from hub docker
# run: docker image pull bensuperpc/${{ matrix.arch_name }}:latest
# continue-on-error: true
2021-05-15 10:40:34 +02:00
- name: build
run: make ${{ matrix.arch_name }}
# - name: test
# run: make ${{ matrix.arch_name }}.test
- name: deploy
if: github.ref == 'refs/heads/master'
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
docker image push bensuperpc/${{ matrix.arch_name }}
- name: clean
run: docker image rm -f bensuperpc/${{ matrix.arch_name }}