Skip to content

Commit 9eacfef

Browse files
Initial commit
0 parents  commit 9eacfef

File tree

97 files changed

+3321
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3321
-0
lines changed

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23+
hs_err_pid*
24+
complete/bin
25+
.idea*
26+
.gradle/*
27+
app/bin/
28+
.vscode/settings.json
29+
.DS_Store
30+
labs/.DS_Store

.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"MD013": false,
3+
"MD033": {
4+
"allowed_elements": ["details", "summary"]
5+
}
6+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Sofus Albertsen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Github Actions katas
2+
3+
## Introduction
4+
5+
This repository contains a set of exercises to learn Github Actions.
6+
7+
### Exercises
8+
9+
* [Setup](./labs/setup.md)
10+
* [Build app](./labs/build-app.md)
11+
* [Extending the Pipeline](./labs/extend-pipeline.md)
12+
* [Storing Artifacts](./labs/storing-artifacts.md)
13+
* [Building Docker images](./labs/docker-image.md)
14+
* [Systems test](./labs/systems-test.md)
15+
* [Reusable workflows](./labs/reusable.md)
16+
* [Pull Request based workflow](./labs/pr-workflow.md)
17+
* [Build app on multiple environments](./labs/matrix-builds.md)
18+
19+
### Rough exercises (not yet ready)
20+
21+
* [Reusing build cache](./labs/build-cache.md)
22+
* [Selfhosted runners](./labs/selfhosted-runner.md)
23+
24+
## Resources
25+
26+
* [Understand a workflow file](https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions#understanding-the-workflow-file)
27+
* [List of starter workflow files for many different languages](https://github.com/actions/starter-workflows/tree/main/ci)
28+
* [A curated list of awesome things related to GitHub Actions](https://github.com/sdras/awesome-actions)
29+
* [Githubs own Hands On Labs](https://github.com/ps-actions-sandbox/ActionsFundamentals)

TRAINER.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Instructions

app/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Thumbs.db
2+
.DS_Store
3+
.gradle
4+
build/
5+
target/
6+
out/
7+
.idea
8+
*.iml
9+
*.ipr
10+
*.iws
11+
.project
12+
.settings
13+
.classpath

app/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM adoptopenjdk/openjdk11-openj9:alpine-slim
2+
LABEL author="Sofus Albertsen"
3+
COPY build/libs/app-*-all.jar app.jar
4+
EXPOSE 8000
5+
CMD java -Dcom.sun.management.jmxremote -noverify ${JAVA_OPTS} -jar app.jar

app/Dockerfile-multistage

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM gradle:6-jdk11 as builder
2+
COPY --chown=gradle:gradle . /home/gradle/src
3+
WORKDIR /home/gradle/src
4+
RUN gradle shadowjar
5+
6+
FROM adoptopenjdk/openjdk11-openj9:alpine-slim
7+
LABEL author="Sofus Albertsen"
8+
COPY --from=builder /home/gradle/src/build/libs/app-*-all.jar app.jar
9+
EXPOSE 8000
10+
CMD java -Dcom.sun.management.jmxremote -noverify ${JAVA_OPTS} -jar app.jar

app/build.gradle

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
plugins {
2+
id "net.ltgt.apt-eclipse" version "0.21"
3+
id "com.github.johnrengelman.shadow" version "5.0.0"
4+
id "application"
5+
}
6+
7+
8+
9+
version "0.1"
10+
group "example.micronaut"
11+
12+
repositories {
13+
mavenCentral()
14+
maven { url "https://jcenter.bintray.com" }
15+
}
16+
17+
configurations {
18+
// for dependencies that are needed for development only
19+
developmentOnly
20+
}
21+
22+
dependencies {
23+
annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
24+
annotationProcessor "io.micronaut:micronaut-inject-java"
25+
annotationProcessor "io.micronaut:micronaut-validation"
26+
implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
27+
implementation "io.micronaut:micronaut-inject"
28+
implementation "io.micronaut:micronaut-validation"
29+
implementation "io.micronaut:micronaut-runtime"
30+
implementation "javax.annotation:javax.annotation-api"
31+
implementation "io.micronaut:micronaut-http-server-netty"
32+
implementation "io.micronaut:micronaut-http-client"
33+
runtimeOnly "ch.qos.logback:logback-classic:1.2.3"
34+
testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
35+
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
36+
testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")
37+
testImplementation "org.junit.jupiter:junit-jupiter-api"
38+
testImplementation "io.micronaut.test:micronaut-test-junit5"
39+
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
40+
}
41+
42+
test.classpath += configurations.developmentOnly
43+
44+
mainClassName = "example.micronaut.Application"
45+
// use JUnit 5 platform
46+
test {
47+
useJUnitPlatform()
48+
}
49+
tasks.withType(JavaCompile){
50+
options.encoding = "UTF-8"
51+
options.compilerArgs.add('-parameters')
52+
}
53+
54+
shadowJar {
55+
mergeServiceFiles()
56+
}
57+
58+
run.classpath += configurations.developmentOnly
59+
run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')

app/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
micronautVersion=1.2.7

0 commit comments

Comments
 (0)