From f8fb128e970b38cc5ceb059827ac985af65411e7 Mon Sep 17 00:00:00 2001 From: Sergey Stepanov Date: Mon, 16 Oct 2023 13:24:04 +0300 Subject: [PATCH] Update CI --- .github/workflows/build.yml | 78 +++++++++--------------------- .github/workflows/docker_build.yml | 12 +++++ 2 files changed, 34 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/docker_build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4da180c58..a37d2feda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,33 +16,39 @@ on: jobs: build: - name: Build strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - step: [ build, test ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: 1.20.7 + go-version: 1.20.8 - - name: Get Linux dev libraries and tools + - name: Linux if: matrix.os == 'ubuntu-latest' + env: + MESA_GL_VERSION_OVERRIDE: 3.3COMPAT run: | sudo apt-get -qq update - sudo apt-get -qq install -y make pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev libyuv-dev libgl1-mesa-glx + sudo apt-get -qq install -y \ + make pkg-config \ + libvpx-dev libx264-dev libopus-dev libyuv-dev \ + libsdl2-dev libgl1-mesa-glx + + make build + xvfb-run --auto-servernum make test verify-cores - - name: Get MacOS dev libraries and tools + - name: macOS if: matrix.os == 'macos-latest' run: | brew install pkg-config libvpx x264 opus sdl2 jpeg-turbo + make build test verify-cores - - name: Get Windows dev libraries and tools + - uses: msys2/setup-msys2@v2 if: matrix.os == 'windows-latest' - uses: msys2/setup-msys2@v2 with: msystem: MINGW64 path-type: inherit @@ -57,61 +63,21 @@ jobs: mingw-w64-x86_64-SDL2 mingw-w64-x86_64-libyuv - - name: Get Windows OpenGL drivers - if: matrix.step == 'test' && matrix.os == 'windows-latest' + - name: Windows + if: matrix.os == 'windows-latest' + env: + MESA_GL_VERSION_OVERRIDE: 3.3COMPAT shell: msys2 {0} run: | wget -q https://github.com/pal1000/mesa-dist-win/releases/download/20.2.1/mesa3d-20.2.1-release-mingw.7z "/c/Program Files/7-Zip/7z.exe" x mesa3d-20.2.1-release-mingw.7z -omesa echo -e " 2\r\n 8\r\n " >> commands ./mesa/systemwidedeploy.cmd < ./commands - - - name: Build Windows app - if: matrix.step == 'build' && matrix.os == 'windows-latest' - shell: msys2 {0} - run: | - make build - - - name: Build Linux app - if: matrix.step == 'build' && matrix.os == 'ubuntu-latest' - run: | - make build - - - name: Build macOS app - if: matrix.step == 'build' && matrix.os == 'macos-latest' - run: | - make build - - - name: Test (windows-latest) - if: matrix.step == 'test' && matrix.os == 'windows-latest' && always() - shell: msys2 {0} - env: - MESA_GL_VERSION_OVERRIDE: 3.3COMPAT - run: | - GL_CTX=-autoGlContext make test verify-cores - - - name: Test (ubuntu-latest) - if: matrix.step == 'test' && matrix.os == 'ubuntu-latest' && always() - env: - MESA_GL_VERSION_OVERRIDE: 3.3COMPAT - run: | - GL_CTX=-autoGlContext xvfb-run --auto-servernum make test verify-cores - - - name: Test (macos-latest) - if: matrix.step == 'test' && matrix.os == 'macos-latest' && always() - run: | - make test verify-cores + + make build test verify-cores - uses: actions/upload-artifact@v3 - if: matrix.step == 'test' && always() + if: always() with: name: emulator-test-frames path: _rendered/*.png - - build_docker: - name: Build (docker) - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v3 - - run: DOCKER_BUILDKIT=1 docker build --build-arg VERSION=$(./scripts/version.sh) . diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml new file mode 100644 index 000000000..65bc58568 --- /dev/null +++ b/.github/workflows/docker_build.yml @@ -0,0 +1,12 @@ +name: docker_build +on: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: DOCKER_BUILDKIT=1 docker build --build-arg VERSION=$(./scripts/version.sh) .