-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
4 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,21 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
|
||
jobs: | ||
docker-build: | ||
uses: ./.github/workflows/docker.yml | ||
secrets: inherit | ||
|
||
unit-tests: | ||
needs: docker-build | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
test-type: unit-test | ||
|
||
data-api-tests: | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
test-type: data-test |
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,38 @@ | ||
name: docker | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKER_ACCESS_TOKEN: | ||
required: true | ||
|
||
env: | ||
DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}/climada_env:${{ github.ref_name }} | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: peanutfunn/climada_env:${{ github.ref_name }} |
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,39 @@ | ||
name: test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
test-type: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
unit-test: | ||
if: inputs.test-type == 'unit-test' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: peanutfunn/climada_env:${{ github.ref_name }} | ||
options: --user root | ||
steps: | ||
- | ||
name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- | ||
name: Run Unit Tests | ||
run: | | ||
micromamba run python -m coverage run tests_runner.py unit | ||
data-test: | ||
if: inputs.test-type == 'data-test' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: peanutfunn/climada_env:${{ github.ref_name }} | ||
options: --user root | ||
steps: | ||
- | ||
name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- | ||
name: Run Unit Tests | ||
run: | | ||
micromamba run python test_data_api.py |