From 59c839dd70aaaacfe0c2b51459a06e1d69ea68ad Mon Sep 17 00:00:00 2001 From: Xavi Ablaza Date: Wed, 2 Apr 2025 17:08:49 +0700 Subject: [PATCH 1/2] Update ci workflow --- .github/workflows/ci.yml | 45 +++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 908be79..e8f1546 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,37 @@ -name: Crystal CI +name: thunderstore_client CI on: + push: + branches: [ "main" ] pull_request: branches: [ "main" ] jobs: - build: + check-format: + runs-on: ubuntu-latest + container: + image: crystallang/crystal:1.14.0 + steps: + - uses: actions/checkout@v4 + - name: Format + run: crystal tool format --check + specs: runs-on: ubuntu-latest + container: + image: crystallang/crystal:1.14.0 steps: - - uses: actions/setup-node@v4 - with: - node-version: 20.x - - uses: crystal-lang/install-crystal@v1 - with: - crystal: 1.6.2 - - name: Download source - uses: actions/checkout@v4 - - name: Install dependencies - run: shards install - - name: Run tests - run: crystal spec + - uses: actions/checkout@v4 + - name: Set up Crystal cache + uses: actions/cache@v4 + id: crystal-cache + with: + path: | + ~/.cache/crystal + lib + lucky_tasks + key: ${{ runner.os }}-crystal-${{ hashFiles('**/shard.lock') }} + restore-keys: | + ${{ runner.os }}-crystal- + - name: Install shards + if: steps.crystal-cache.outputs.cache-hit != 'true' + run: shards check || shards install --ignore-crystal-version + - name: Run tests + run: crystal spec From 7eb8ee1e23477821991fc9f8c23495d05f6a70c1 Mon Sep 17 00:00:00 2001 From: Xavi Ablaza Date: Wed, 2 Apr 2025 17:09:43 +0700 Subject: [PATCH 2/2] Use crystal 1.14.0 in docs generation workflow --- .github/workflows/docs.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3eab2f0..d9e73e4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,35 +1,29 @@ name: Crystal Docs Generation - on: push: branches: [ "main" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: - # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write - # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false - jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/setup-node@v4 with: node-version: 20.x - uses: crystal-lang/install-crystal@v1 with: - crystal: 1.6.2 + crystal: 1.14.0 - uses: actions/checkout@v4 - name: Generate docs run: crystal docs @@ -37,7 +31,6 @@ jobs: run: mv docs/ _site/ - name: Upload artifact uses: actions/upload-pages-artifact@v3 - # Deployment job deploy: environment: