From 4dec1ca934247974b37e5beac55dcecf45bcb8b2 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 27 Aug 2024 00:28:44 +0300 Subject: [PATCH] ci: Overhaul CI by copying from CaSILE --- .github/linters/.dockerfilelintrc | 2 -- .github/linters/.hadolint.yml | 4 --- .github/linters/.markdown-lint.yml | 5 --- .github/workflows/build.yml | 55 ------------------------------ .github/workflows/commitlint.yml | 6 ++-- .github/workflows/deploy.yml | 17 +++++---- .github/workflows/release.yml | 14 +++++--- .github/workflows/rust_bloat.yml | 10 +++--- .github/workflows/rust_lint.yml | 13 ++++--- .github/workflows/rust_test.yml | 9 +++-- .github/workflows/versioning.yml | 4 +-- 11 files changed, 44 insertions(+), 95 deletions(-) delete mode 100644 .github/linters/.dockerfilelintrc delete mode 100644 .github/linters/.hadolint.yml delete mode 100644 .github/linters/.markdown-lint.yml delete mode 100644 .github/workflows/build.yml diff --git a/.github/linters/.dockerfilelintrc b/.github/linters/.dockerfilelintrc deleted file mode 100644 index 3b9a1b2..0000000 --- a/.github/linters/.dockerfilelintrc +++ /dev/null @@ -1,2 +0,0 @@ -rules: - missing_tag: off diff --git a/.github/linters/.hadolint.yml b/.github/linters/.hadolint.yml deleted file mode 100644 index 8191faa..0000000 --- a/.github/linters/.hadolint.yml +++ /dev/null @@ -1,4 +0,0 @@ -ignored: - - SC2016 - - SC2039 - - DL4006 diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml deleted file mode 100644 index efbaf04..0000000 --- a/.github/linters/.markdown-lint.yml +++ /dev/null @@ -1,5 +0,0 @@ -MD001: false -MD012: false -MD013: false -MD014: false -MD024: false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 4d9fa17..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-20.04 - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Fetch Tags - run: | - git fetch --prune --tags ||: - - name: Setup system dependencies - run: | - sudo add-apt-repository universe - sudo apt-get update - sudo apt-get install autoconf-archive fontmake fonttools libgit2-dev psautohint python3 python3-defcon python3-pip python3-ufo2ft python3-ufolib2 sfnt2woff-zopfli ttfautohint ufonormalizer woff2 zsh - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Cache cargo - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: cargo-build-${{ hashFiles('**/Cargo.lock') }} - - name: Setup Python dependencies - run: pip install cffsubr font-v gftools pcpp git+git://github.com/alif-type/sfdLib.git@v1.0.7#egg=sfdLib sfdnormalize skia-pathops vttLib - - name: Configure - run: | - export PATH="$HOME/.local/bin:$PATH" - ./bootstrap.sh - ./configure - echo "VERSION=$(cat .version)" >> $GITHUB_ENV - echo "MAKEFLAGS=-j$(nproc) -Otarget" >> $GITHUB_ENV - - name: Build - run: | - export PATH="$HOME/.local/bin:$PATH" - make - - name: Build source package - run: | - export PATH="$HOME/.local/bin:$PATH" - make dist - - name: Upload Artifacts - uses: actions/upload-artifact@v2 - with: - name: fontship-${{ env.VERSION }} - path: fontship*-${{ env.VERSION }}.zip diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index ffac1bb..16e8510 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -5,13 +5,13 @@ on: [push, pull_request] jobs: commitlint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Run ‘commitlint’ linter - uses: wagoid/commitlint-github-action@v2 + uses: wagoid/commitlint-github-action@v5 with: configFile: '.commitlintrc.yml' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a81cc07..7e1e18f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,10 +13,10 @@ jobs: ghcr: strategy: fail-fast: false - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Fetch tags @@ -24,18 +24,21 @@ jobs: git fetch --prune --tags ||: - name: Setup system dependencies run: | - sudo apt-get install autoconf-archive + sudo apt-get install clang mold - name: Configure run: | - echo "REF=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV ./bootstrap.sh - ./configure --without-{bash,fish,zsh}-completion-dir --disable-dependency-checks - - name: Publish Docker Image to GH Pakcages + ./configure \ + --without-{bash,fish,zsh}-completion-dir \ + --enable-developer-mode \ + --disable-dependency-checks \ + CURL=curl DOCKER=docker DIFF=diff TR=tr SORT=sort + - name: Publish Docker Image to GH Container Registry run: | make docker-build-push env: DOCKER_REGISTRY: ghcr.io DOCKER_REPO: ${{ github.repository }} - DOCKER_TAG: ${{ env.REF }} + DOCKER_TAG: ${{ github.ref_name }} DOCKER_USERNAME: ${{ github.actor }} DOCKER_PAT: ${{ secrets.CR_FONTSHIP }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e0241e..a884953 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,26 +10,30 @@ jobs: ghrelase: strategy: fail-fast: false - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup system dependencies run: | - sudo apt-get install autoconf-archive + sudo apt-get install clang mold - name: Configure run: | echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV echo "${GITHUB_REF#refs/*/v}" > .tarball-version ./bootstrap.sh - ./configure --without-{bash,fish,zsh}-completion-dir --disable-dependency-checks + ./configure \ + --enable-developer-mode \ + --without-{bash,fish,zsh}-completion-dir \ + --disable-dependency-checks - name: Build source package run: | make dist - name: Publish Release uses: softprops/action-gh-release@v1 + if: github.repository == 'tehleagueof/fontship' && startsWith(github.ref, 'refs/tags/v') with: body_path: fontship-${{ env.VERSION }}.md files: | fontship-${{ env.VERSION }}.zip - fontship-${{ env.VERSION }}.tar.xz + fontship-${{ env.VERSION }}.tar.zst diff --git a/.github/workflows/rust_bloat.yml b/.github/workflows/rust_bloat.yml index 1cdc82b..d77eb57 100644 --- a/.github/workflows/rust_bloat.yml +++ b/.github/workflows/rust_bloat.yml @@ -5,17 +5,19 @@ on: [ "pull_request" ] jobs: cargo_bloat: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust uses: actions-rs/toolchain@v1 with: profile: minimal - name: Cache Rust - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: Run cargo bloat - uses: orf/cargo-bloat-action@v1 + # https://github.com/orf/cargo-bloat-action/pull/302 + # uses: orf/cargo-bloat-action@v1 + uses: Kobzol/cargo-bloat-action@github-actions-cache with: token: ${{ github.token }} diff --git a/.github/workflows/rust_lint.yml b/.github/workflows/rust_lint.yml index ed4555a..583b278 100644 --- a/.github/workflows/rust_lint.yml +++ b/.github/workflows/rust_lint.yml @@ -10,17 +10,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust uses: actions-rs/toolchain@v1 with: profile: minimal components: rustfmt - name: Cache Rust - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: Run rustfmt run: | - git ls-files '*.rs' | xargs rustfmt --check + git ls-files '*.rs' '*.rs.in' | xargs rustfmt --check --config skip_children=true clippy: strategy: @@ -28,14 +28,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Setup system dependencies + run: | + sudo apt-get install clang mold - name: Install Rust uses: actions-rs/toolchain@v1 with: profile: minimal components: clippy - name: Cache Rust - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 with: token: ${{ github.token }} diff --git a/.github/workflows/rust_test.yml b/.github/workflows/rust_test.yml index 7f5cbf2..2ce96c2 100644 --- a/.github/workflows/rust_test.yml +++ b/.github/workflows/rust_test.yml @@ -5,19 +5,22 @@ on: [push, pull_request] jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Fetch tags run: | git fetch --prune --tags ||: + - name: Setup system dependencies + run: | + sudo apt-get install clang mold - name: Install Rust uses: actions-rs/toolchain@v1 - name: Cache Rust - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml index d8e458d..33a6032 100644 --- a/.github/workflows/versioning.yml +++ b/.github/workflows/versioning.yml @@ -7,11 +7,11 @@ on: jobs: actions-tagger: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: Actions-R-Us/actions-tagger@v2 with: publish_latest_tag: true