Skip to content

Commit

Permalink
Merge branch 'refactors-0.20.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Nov 6, 2024
2 parents 079407e + e001a33 commit ede1146
Show file tree
Hide file tree
Showing 1,298 changed files with 33,279 additions and 20,287 deletions.
8 changes: 4 additions & 4 deletions .ameba.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Documentation/DocumentationAdmonition:
Enabled: false

Naming/RescuedExceptionsVariableName:
Excluded:
- spec/examples_spec.cr

Metrics/CyclomaticComplexity:
Enabled: false

Expand All @@ -16,3 +12,7 @@ Lint/Typos:

Lint/UselessAssign:
ExcludeTypeDeclarations: true

Lint/SpecFilename:
Excluded:
- spec/spec_helpers.cr
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-13, macos-latest]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -29,13 +29,13 @@ jobs:
name: Build binary (Linux)
run: |
mkdir build
docker-compose run --rm app crystal build src/mint.cr -o build/mint-${GITHUB_REF_SLUG}-linux --static --no-debug --release
docker compose run --rm app crystal build src/mint.cr -o build/mint-${GITHUB_REF_SLUG}-linux --static --no-debug --release
- if: matrix.os == 'macos-latest'
- if: startsWith(matrix.os, 'macos')
name: Build binary (macOS)
run: |
mkdir build
crystal build src/mint.cr -o build/mint-${GITHUB_REF_SLUG}-osx --release
crystal build src/mint.cr -o build/mint-${GITHUB_REF_SLUG}-${{ matrix.os }} --release
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -50,15 +50,15 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.AWS_BUCKET }}
aws_key_id: ${{ secrets.AWS_KEY }}
source_dir: build
destination_dir: ""
source_dir: build

- if: startsWith(github.ref, 'refs/tags/')
name: Upload to GitHub Releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: build/*
overwrite: true
file_glob: true
file: build/*
16 changes: 8 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
- name: Log into ${{ env.REGISTRY }} registry
uses: docker/login-action@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
Expand All @@ -52,12 +52,12 @@ jobs:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
type=sha,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
type=ref,event=pr
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
Expand All @@ -67,10 +67,10 @@ jobs:
with:
context: .
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
platforms: |
linux/amd64
linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
66 changes: 66 additions & 0 deletions .github/workflows/ci-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on:
workflow_call:
inputs:
crystal-version:
required: true
type: string

jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
runs-on: ${{ matrix.os }}

steps:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ inputs.crystal-version }}

- if: matrix.os == 'ubuntu-latest'
name: Install `xmllint` (Linux)
run: |
sudo apt-get update
sudo apt-get install libxml2-utils -y
- name: Download source
uses: actions/checkout@v4

- name: Install dependencies
run: shards install

- name: Run specs
run: crystal spec --error-on-warnings --error-trace

- name: Build the binary
run: shards build --error-on-warnings --error-trace

- name: Run CLI specs
run: crystal spec spec_cli/*_spec.cr spec_cli/**/*_spec.cr --error-on-warnings --error-trace

- name: Run core specs (Firefox)
working-directory: ./core/tests
run: ../../bin/mint test -b firefox

- name: Run core specs (Google Chrome)
working-directory: ./core/tests
run: ../../bin/mint test -b chrome

- name: Check formatting (Mint)
working-directory: ./core
run: ../bin/mint format --check

- name: Check formatting (Mint tests)
working-directory: ./core/tests
run: ../../bin/mint format --check

- name: Check formatting (Crystal)
run: crystal tool format --check

- name: Run ameba
run: bin/ameba
49 changes: 3 additions & 46 deletions .github/workflows/ci-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,6 @@ on:

jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: nightly

- name: Download source
uses: actions/checkout@v4

- name: Install dependencies
run: shards install

- name: Run specs
run: crystal spec --error-on-warnings --error-trace

- name: Build the binary
run: shards build --error-on-warnings --error-trace

- name: Run core specs (Firefox)
working-directory: ./core/tests
run: ../../bin/mint test -b firefox

- name: Run core specs (Google Chrome)
working-directory: ./core/tests
run: ../../bin/mint test -b chrome

- name: Check formatting (Mint)
working-directory: ./core
run: ../bin/mint format --check

- name: Check formatting (Mint tests)
working-directory: ./core/tests
run: ../../bin/mint format --check

- name: Check formatting (Crystal)
run: crystal tool format --check

- name: Run ameba
run: bin/ameba
uses: ./.github/workflows/ci-base.yml
with:
crystal-version: nightly
49 changes: 3 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,6 @@ on:

jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: latest

- name: Download source
uses: actions/checkout@v4

- name: Install dependencies
run: shards install

- name: Run specs
run: crystal spec --error-on-warnings --error-trace

- name: Build the binary
run: shards build --error-on-warnings --error-trace

- name: Run core specs (Firefox)
working-directory: ./core/tests
run: ../../bin/mint test -b firefox

- name: Run core specs (Google Chrome)
working-directory: ./core/tests
run: ../../bin/mint test -b chrome

- name: Check formatting (Mint)
working-directory: ./core
run: ../bin/mint format --check

- name: Check formatting (Mint tests)
working-directory: ./core/tests
run: ../../bin/mint format --check

- name: Check formatting (Crystal)
run: crystal tool format --check

- name: Run ameba
run: bin/ameba
uses: ./.github/workflows/ci-base.yml
with:
crystal-version: latest
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/lib/
/bin/
/.shards/
.vscode
.vscode
node_modules
coverage
4 changes: 3 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
crystal 1.9.1
crystal 1.14.0
mint 0.19.0
nodejs 20.10.0
yarn 1.22.19
38 changes: 23 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
# Contributing Guideline
# Contributing to Mint

Read the general [Contributing guide][1], and then:
So you've decided to contribute to Mint. Excellent!

## Using the issue tracker

The [issue tracker](https://github.com/mint-lang/mint/issues) is the heart of Mint's work. Use it for bugs, questions, proposals and feature requests.

Please always **open a new issue before sending a pull request** if you want to add a new feature to Mint, unless it is a minor fix, and wait until someone from the core team approves it before you actually start working on it. Otherwise, you risk having the pull request rejected, and the effort implementing it goes to waste. And if you start working on an implementation for an issue, please **let everyone know in the comments** so someone else does not start working on the same thing.

Regardless of the kind of issue, please make sure to look for similar existing issues before posting; otherwise, your issue may be flagged as `duplicated` and closed in favour of the original one. Also, once you open a new issue, please make sure to honour the items listed in the issue template.

If you open a question, remember to close the issue once you are satisfied with the answer and you think
there's no more room for discussion. We'll anyway close the issue after some days.

If something is missing from the language it might be that it's not yet implemented or that it was purposely left out. If in doubt, just ask.

The best place to start an open discussion about potential changes is the [discussions](https://github.com/mint-lang/mint/discussions).

## Contributing Workflow

Read this guide then:

- Fork it (<https://github.com/mint-lang/mint/fork>)
- Create your feature branch (`git checkout -b my-new-feature`)
- Commit your changes (`git commit -am 'Add some feature'`)
- Push to the branch (`git push origin my-new-feature`)
- Create a new [Pull Request](https://github.com/mint-lang/mint/pulls)

[1]: https://github.com/crystal-lang/crystal/blob/master/CONTRIBUTING.md

## Development

### Installing Crystal

We need to install [Crystal](https://crystal-lang.org/) programming language
first. Before installing it, we should install its dependencies.

##### Ubuntu

```
$ sudo apt update
$ sudo apt install pkg-config ubuntu-dev-tools
```

Then, follow [this instruction][2].

[2]: https://crystal-lang.org/install/on_ubuntu/

### Installing Mint dependencies

Once you have Crystal installed install the dependencies needed for building Mint:

```
$ shards install
```
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# We are using crystal as image we are building the binary on
FROM crystallang/crystal:1.9.1-alpine AS build
FROM crystallang/crystal:1.14.0-alpine AS build

# Create a build directory and set it as default
RUN mkdir -p /opt/mint
Expand Down
Loading

0 comments on commit ede1146

Please sign in to comment.