Skip to content

Commit

Permalink
Updating generated CI with latest version (#859)
Browse files Browse the repository at this point in the history
* Updating generated Github CI with latest checkout and cache. Removing tasks cache to avoid issues when migrations change and such. Fixes #817

* Update fixtures and Earthfile to ensure we're using a later version of Crystal
  • Loading branch information
jwoertink authored Apr 15, 2024
1 parent a6dee3a commit 437fee7
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 76 deletions.
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION 0.7
FROM 84codes/crystal:1.6.2-ubuntu-22.04
FROM 84codes/crystal:1.10.0-ubuntu-22.04
WORKDIR /workdir

# gh-action-essential runs only the necessary recipes
Expand Down
2 changes: 1 addition & 1 deletion fixtures/shard_file_template/expected/shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0
targets:
test-shard:
main: src/test-shard.cr
crystal: '>= 1.6.2'
crystal: '>= 1.10.0'
dependencies:
lucky:
github: luckyframework/lucky
Expand Down
2 changes: 1 addition & 1 deletion fixtures/shard_file_template__browser/expected/shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0
targets:
test-shard:
main: src/test-shard.cr
crystal: '>= 1.6.2'
crystal: '>= 1.10.0'
dependencies:
lucky:
github: luckyframework/lucky
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0
targets:
test-shard:
main: src/test-shard.cr
crystal: '>= 1.6.2'
crystal: '>= 1.10.0'
dependencies:
lucky:
github: luckyframework/lucky
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0
targets:
test-shard:
main: src/test-shard.cr
crystal: '>= 1.6.2'
crystal: '>= 1.10.0'
dependencies:
lucky:
github: luckyframework/lucky
Expand Down
2 changes: 1 addition & 1 deletion fixtures/src_template/expected/.crystal-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.2
1.10.0
17 changes: 6 additions & 11 deletions fixtures/src_template/expected/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
Expand All @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
Expand All @@ -41,7 +41,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
services:
postgres:
image: postgres:12-alpine
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
Expand All @@ -54,20 +54,19 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal_version }}

- name: Set up Crystal cache
uses: actions/cache@v2
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-
Expand All @@ -76,11 +75,7 @@ jobs:
if: steps.crystal-cache.outputs.cache-hit != 'true'
run: shards check || shards install

- name: Install npm and Nexploit Repeater
run: |
sudo npm install -g @neuralegion/nexploit-cli --unsafe-perm=true
- name: Build lucky_tasks
if: steps.crystal-cache.outputs.cache-hit != 'true'
run: crystal build tasks.cr -o ./lucky_tasks

- name: Prepare database
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.6.2
FROM crystallang/crystal:1.10.0

# Install utilities required to make this Dockerfile run
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion fixtures/src_template__api_only/expected/.crystal-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.2
1.10.0
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
Expand All @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
Expand All @@ -41,7 +41,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
services:
postgres:
image: postgres:12-alpine
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
Expand All @@ -54,20 +54,19 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal_version }}

- name: Set up Crystal cache
uses: actions/cache@v2
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-
Expand All @@ -77,7 +76,6 @@ jobs:
run: shards check || shards install

- name: Build lucky_tasks
if: steps.crystal-cache.outputs.cache-hit != 'true'
run: crystal build tasks.cr -o ./lucky_tasks

- name: Prepare database
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.6.2
FROM crystallang/crystal:1.10.0

# Install utilities required to make this Dockerfile run
RUN apt-get update && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.2
1.10.0
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
Expand All @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
Expand All @@ -41,7 +41,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
services:
postgres:
image: postgres:12-alpine
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
Expand All @@ -54,7 +54,7 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
Expand All @@ -65,29 +65,28 @@ jobs:
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Set up Yarn cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up Node cache
uses: actions/cache@v2
uses: actions/cache@v4
id: node-cache # use this to check for `cache-hit` (`steps.node-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set up Crystal cache
uses: actions/cache@v2
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-
Expand All @@ -102,7 +101,6 @@ jobs:
- name: Compiling assets
run: yarn prod
- name: Build lucky_tasks
if: steps.crystal-cache.outputs.cache-hit != 'true'
run: crystal build tasks.cr -o ./lucky_tasks

- name: Prepare database
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.6.2
FROM crystallang/crystal:1.10.0

# Install utilities required to make this Dockerfile run
RUN apt-get update && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.2
1.10.0
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
Expand All @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
crystal_version:
- 1.6.2
- 1.10.0
experimental:
- false
runs-on: ubuntu-latest
Expand All @@ -41,7 +41,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
services:
postgres:
image: postgres:12-alpine
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
Expand All @@ -54,7 +54,7 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
Expand All @@ -65,29 +65,28 @@ jobs:
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Set up Yarn cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up Node cache
uses: actions/cache@v2
uses: actions/cache@v4
id: node-cache # use this to check for `cache-hit` (`steps.node-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set up Crystal cache
uses: actions/cache@v2
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-
Expand All @@ -101,11 +100,7 @@ jobs:
run: yarn install --frozen-lockfile --no-progress
- name: Compiling assets
run: yarn prod
- name: Install npm and Nexploit Repeater
run: |
sudo npm install -g @neuralegion/nexploit-cli --unsafe-perm=true
- name: Build lucky_tasks
if: steps.crystal-cache.outputs.cache-hit != 'true'
run: crystal build tasks.cr -o ./lucky_tasks

- name: Prepare database
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.6.2
FROM crystallang/crystal:1.10.0

# Install utilities required to make this Dockerfile run
RUN apt-get update && \
Expand Down
Loading

0 comments on commit 437fee7

Please sign in to comment.