From 8a3ba6412ba01f322ea1555c93aeffebf5e6d77d Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Fri, 10 Nov 2023 00:30:33 +0300 Subject: [PATCH] Upgrade CI/CD (#203) * Add space check * Replace docker build actions * Fix image name * Fix image build --- .github/actions/docker/action.yml | 11 ----------- .github/workflows/ci.yml | 32 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 25 deletions(-) delete mode 100644 .github/actions/docker/action.yml diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml deleted file mode 100644 index 3608f96e..00000000 --- a/.github/actions/docker/action.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Run in docker' -inputs: - run: # id of input - description: 'A command to run' - required: true - default: '' -runs: - using: 'docker' - image: '../../../docker/Dockerfile' - args: - - ${{ inputs.run }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 754a1b2b..9f12ccf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,29 +6,33 @@ jobs: build_linux: runs-on: ubuntu-latest steps: - - name: Cleanup workspace - uses: AutoModality/action-clean@v1 + - name: 'Wipe workspace' + run: find ./ -mount -maxdepth 1 -exec rm -rf {} \; - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: true - - uses: satackey/action-docker-layer-caching@v0.0.11 - continue-on-error: true - with: - key: docker-cache-${{ hashFiles('docker/**') }}-{hash} - restore-keys: docker-cache-${{ hashFiles('docker/**') }}- + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Build docker image - uses: ./.github/actions/docker + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: false + context: docker + tags: qflipper-build:latest + load: true + cache-from: type=gha + cache-to: type=gha,mode=max - name: Build application in docker - run: docker build -t flipp ./docker/ && docker run --rm --privileged -v $(pwd):/project flipp /project/build_linux.sh + run: docker run --rm --privileged -v $(pwd):/project qflipper-build:latest /project/build_linux.sh - name: Publish application - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: qFlipper-x86_64.AppImage path: | @@ -48,7 +52,7 @@ jobs: MAC_OS_SIGNING_PASSWORD: ${{ secrets.MAC_OS_SIGNING_PASSWORD }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: true @@ -71,7 +75,7 @@ jobs: SIGNING_TOOL: ${{ secrets.WIN_SIGNING_TOOL }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: true