-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from AppsFlyer/branches-ci-step
[skip ci] add branch ci step
- Loading branch information
Showing
4 changed files
with
181 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
on: [workflow_call] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: corretto | ||
java-version: 8 | ||
|
||
- name: Restore local Maven repository from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Validate SNAPSHOT version | ||
env: | ||
SNAPSHOT_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}-SNAPSHOT$ | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
lein pom | ||
export VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1) | ||
echo "Version is:" $VERSION | ||
if [[ !("$VERSION" =~ $SNAPSHOT_REGEX) ]] | ||
then | ||
echo "Version isn't a SNAPSHOT version:" $VERSION | ||
exit 0 | ||
fi | ||
- name: Setup linter | ||
uses: DeLaGuardo/setup-clj-kondo@master | ||
with: | ||
version: '2021.06.18' | ||
|
||
- name: Lint | ||
run: clj-kondo --lint src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "Push CI - branches" | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
|
||
test: | ||
needs: build | ||
uses: ./.github/workflows/test.yml | ||
|
||
deploy: | ||
needs: test | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: corretto | ||
java-version: 8 | ||
|
||
- name: Restore local Maven repository from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Deploy SNAPSHOT version | ||
env: | ||
SNAPSHOT_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}-SNAPSHOT$ | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} | ||
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} | ||
run: | | ||
git config --global user.name "github-actions-bot" | ||
git config --global user.email "<>" | ||
lein pom | ||
export SNAPSHOT_VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1) | ||
echo "SNAPSHOT version is:" $SNAPSHOT_VERSION | ||
if [[ !("$SNAPSHOT_VERSION" =~ $SNAPSHOT_REGEX) ]] | ||
then | ||
echo "Version isn't a SNAPSHOT version:" $SNAPSHOT_VERSION ", skipping deployment to Clojars..." | ||
exit 1 | ||
fi | ||
lein deploy | ||
echo "SNAPSHOT version:" $SNAPSHOT_VERSION"; commit: "${{github.sha}}"; successfully deployed to Clojars" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
on: [workflow_call] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: corretto | ||
java-version: 8 | ||
|
||
- name: Restore local Maven repository from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Generate proto files | ||
run: lein protodeps generate | ||
|
||
- name: Unit tests | ||
env: | ||
IP_STACK_ACCESS_KEY: ${{ secrets.IP_STACK_ACCESS_KEY }} | ||
run: lein cloverage --html --lcov --junit | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1.19 | ||
#if: always() | ||
if: false | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: "target/coverage/junit.xml" | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
if: false | ||
with: | ||
path-to-lcov: "target/coverage/lcov.info" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |