-
Notifications
You must be signed in to change notification settings - Fork 29
87 lines (73 loc) · 2.83 KB
/
Copy pathformat_then_test.yml
File metadata and controls
87 lines (73 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This workflow tests and releases the latest build
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build-and-test"
build-and-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Use the standard Java Action to setup Java
# we want the latest Java 12
- uses: actions/setup-java@v1
with:
java-version: '12.x'
# Use the community Action to install Flutter
# we want the stable channel
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
# Get flutter packages
- run: flutter pub get
# Check for any formatting issues in the code.
- run: flutter format .
# Analyze our Dart code, but don't fail with there are issues.
- run: flutter analyze . --preamble --no-fatal-infos --no-fatal-warnings
# Run our tests
- run: flutter test --coverage
# Upload to codecov
- uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage/lcov.info
# # Parse a tag from the commit message
# - id: get-tag
# shell: python3 {0}
# run: |
# import json
# import os
# with open(os.environ['GITHUB_EVENT_PATH']) as fh:
# event = json.load(fh)
# version = event['head_commit']['message'].split()[0]
# print("::set-output name=tag::" + version)
# Get current datetime in ISO format
- id: date
run: echo "::set-output name=date::$(date -u +'%Y-%m-%d')"
# Create a Release
- uses: softprops/action-gh-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.date.outputs.date }}v${{ github.run_number }}
name: ${{ steps.date.outputs.date }}v${{ github.run_number }}
# tag_name: ${{ github.event.commits[0].message }}
# name: ${{ github.event.commits[0].message }}
# tag_name: v${{ steps.get-tag.outputs.tag }}
# name: ${{ steps.get-tag.outputs.tag }}
body: |
See CHANGELOG.md
draft: false
prerelease: false