mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Merge pull request #182 from crystal-ameba/Sija/move-ci-to-github-actions
Switch CI from Travis to GitHub Actions
This commit is contained in:
		
						commit
						bedf3a68d7
					
				
					 5 changed files with 98 additions and 32 deletions
				
			
		
							
								
								
									
										42
									
								
								.github/workflows/ci.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								.github/workflows/ci.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,42 @@ | ||||||
|  | name: CI | ||||||
|  | 
 | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |   pull_request: | ||||||
|  |     branches: | ||||||
|  |       # Branches from forks have the form 'user:branch-name' so we only run | ||||||
|  |       # this job on pull_request events for branches that look like fork | ||||||
|  |       # branches. Without this we would end up running this job twice for non | ||||||
|  |       # forked PRs, once for the push and then once for opening the PR. | ||||||
|  |       - "**:**" | ||||||
|  |   schedule: | ||||||
|  |     - cron: "0 3 * * 1" # Every monday at 3 AM | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   test: | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         os: [ubuntu-latest, macos-latest] | ||||||
|  |         crystal: [latest, nightly] | ||||||
|  |     runs-on: ${{ matrix.os }} | ||||||
|  | 
 | ||||||
|  |     steps: | ||||||
|  |       - name: Install Crystal | ||||||
|  |         uses: oprypin/install-crystal@v1 | ||||||
|  |         with: | ||||||
|  |           crystal: ${{ matrix.crystal }} | ||||||
|  | 
 | ||||||
|  |       - name: Download source | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  | 
 | ||||||
|  |       - name: Install dependencies | ||||||
|  |         run: shards install | ||||||
|  |         env: | ||||||
|  |           SHARDS_OPTS: --ignore-crystal-version | ||||||
|  | 
 | ||||||
|  |       - name: Run specs | ||||||
|  |         run: make test | ||||||
|  | 
 | ||||||
|  |       - name: Check formatting | ||||||
|  |         run: crystal tool format --check | ||||||
							
								
								
									
										54
									
								
								.github/workflows/docs.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								.github/workflows/docs.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,54 @@ | ||||||
|  | name: Docs | ||||||
|  | 
 | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: [master] | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   build: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - name: Inject slug/short variables | ||||||
|  |         uses: rlespinasse/github-slug-action@v3.x | ||||||
|  | 
 | ||||||
|  |       - name: Install Crystal | ||||||
|  |         uses: oprypin/install-crystal@v1 | ||||||
|  | 
 | ||||||
|  |       - name: Download source | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |         with: | ||||||
|  |           persist-credentials: false | ||||||
|  | 
 | ||||||
|  |       - name: Install dependencies | ||||||
|  |         run: shards install | ||||||
|  |         env: | ||||||
|  |           SHARDS_OPTS: --ignore-crystal-version | ||||||
|  | 
 | ||||||
|  |       - name: Build docs | ||||||
|  |         run: | | ||||||
|  |           sed -i -e 's:<.*>::g' README.md | ||||||
|  |           crystal docs --project-version="${{ env.GITHUB_REF_SLUG }}" --source-refname="${{ env.GITHUB_SHA_SHORT }}" | ||||||
|  | 
 | ||||||
|  |       - name: Upload artifacts | ||||||
|  |         uses: actions/upload-artifact@v2 | ||||||
|  |         with: | ||||||
|  |           name: docs | ||||||
|  |           path: docs | ||||||
|  | 
 | ||||||
|  |   deploy: | ||||||
|  |     needs: build | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - name: Download artifacts | ||||||
|  |         uses: actions/download-artifact@v2 | ||||||
|  |         with: | ||||||
|  |           name: docs | ||||||
|  |           path: docs | ||||||
|  | 
 | ||||||
|  |       - name: Deploy docs 🚀 | ||||||
|  |         uses: JamesIves/github-pages-deploy-action@3.7.1 | ||||||
|  |         with: | ||||||
|  |           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |           BRANCH: gh-pages | ||||||
|  |           FOLDER: docs | ||||||
|  |           CLEAN: true | ||||||
							
								
								
									
										2
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							|  | @ -7,5 +7,3 @@ | ||||||
| # Libraries don't need dependency lock | # Libraries don't need dependency lock | ||||||
| # Dependencies will be locked in application that uses them | # Dependencies will be locked in application that uses them | ||||||
| /shard.lock | /shard.lock | ||||||
| 
 |  | ||||||
| *.html |  | ||||||
							
								
								
									
										28
									
								
								.travis.yml
									
										
									
									
									
								
							
							
						
						
									
										28
									
								
								.travis.yml
									
										
									
									
									
								
							|  | @ -1,28 +0,0 @@ | ||||||
| language: crystal |  | ||||||
| 
 |  | ||||||
| crystal: |  | ||||||
|   - latest |  | ||||||
|   - nightly |  | ||||||
| 
 |  | ||||||
| jobs: |  | ||||||
|   allow_failures: |  | ||||||
|     - crystal: nightly |  | ||||||
| 
 |  | ||||||
| install: |  | ||||||
|   - shards install |  | ||||||
| 
 |  | ||||||
| script: |  | ||||||
|   - make test |  | ||||||
|   - crystal tool format --check |  | ||||||
|   - sed -i -e 's:<.*>::g' README.md |  | ||||||
|   - crystal docs |  | ||||||
| 
 |  | ||||||
| deploy: |  | ||||||
|   provider: pages |  | ||||||
|   github_token: $GITHUB_TOKEN |  | ||||||
|   project_name: ameba |  | ||||||
|   skip_cleanup: true |  | ||||||
|   on: |  | ||||||
|     branch: master |  | ||||||
|   local_dir: docs |  | ||||||
|   verbose: true |  | ||||||
|  | @ -8,7 +8,7 @@ | ||||||
|     </sup> |     </sup> | ||||||
|   </p> |   </p> | ||||||
|   <p align="center"> |   <p align="center"> | ||||||
|     <a href="https://travis-ci.org/crystal-ameba/ameba"><img src="https://travis-ci.org/crystal-ameba/ameba.svg?branch=master"></a> |     <a href="https://github.com/crystal-ameba/ameba/actions?query=workflow%3ACI"><img src="https://github.com/crystal-ameba/ameba/workflows/CI/badge.svg"></a> | ||||||
|     <a href="https://github.com/crystal-ameba/ameba/releases"><img src="https://img.shields.io/github/release/crystal-ameba/ameba.svg?maxAge=360"></a> |     <a href="https://github.com/crystal-ameba/ameba/releases"><img src="https://img.shields.io/github/release/crystal-ameba/ameba.svg?maxAge=360"></a> | ||||||
|     <a href="https://github.com/crystal-ameba/ameba/blob/master/LICENSE"><img src="https://img.shields.io/github/license/crystal-ameba/ameba.svg"></a> |     <a href="https://github.com/crystal-ameba/ameba/blob/master/LICENSE"><img src="https://img.shields.io/github/license/crystal-ameba/ameba.svg"></a> | ||||||
|   <a href="https://gitter.im/veelenga/ameba?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/veelenga/ameba.svg"></a> |   <a href="https://gitter.im/veelenga/ameba?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/veelenga/ameba.svg"></a> | ||||||
|  | @ -169,7 +169,7 @@ In this example we define default globs and exclude `src/compiler` folder: | ||||||
| Globs: | Globs: | ||||||
|   - **/*.cr |   - **/*.cr | ||||||
|   - !lib |   - !lib | ||||||
|    | 
 | ||||||
| Excluded: | Excluded: | ||||||
|   - src/compiler |   - src/compiler | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue