-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (50 loc) · 1.67 KB
/
prepareZip.yml
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
name: Prepare Code Challenge Zip
on:
push:
branches:
- 'base'
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
- name: Run Unit Tests
run: ./gradlew test
zip:
name: Zip artifact
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare artifact
run: git checkout -b candidate;
git branch -D base;
git remote set-url origin git@github.com:motain/android-code-challenge-submissions.git;
# INFO: We're archiving folder manually to keep file permissions.
# It's workaround to avoid file permissions change on artifact upload. More info: https://github.com/actions/upload-artifact/issues/38
# After actions/upload-artifact gets fix, this step should be avoided and 'path' value for upload-artifact shuld be changed to `path: ./`
- name: Zip artifact (workaround for upload-artifact permissions bug)
run: mkdir ../artifact;
cd ..;
zip -qq -r ./artifact/android-code-challenge-submissions.zip ./android-code-challenge-submissions;
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: android-code-challenge-submissions
path: ../artifact
ktlint:
runs-on: ubuntu-latest
steps:
- name: "checkout"
uses: actions/checkout@v2
- name: "ktlint"
uses: "vroy/gha-kotlin-linter@v1"