|
6 | 6 | - main |
7 | 7 | pull_request: |
8 | 8 |
|
9 | | -env: |
10 | | - DOCKER_REGISTRY: ghcr.io |
11 | | - DOCKER_IMAGE_NAME: ${{ github.repository }} |
12 | | - |
13 | 9 | jobs: |
14 | | - codecov: |
15 | | - name: codecov |
16 | | - runs-on: ubuntu-latest |
17 | | - steps: |
18 | | - - uses: actions/checkout@v2 |
19 | | - - name: Execute linters and test suites |
20 | | - run: ./docker/cibuild |
21 | | - - name: Upload All coverage to Codecov |
22 | | - uses: codecov/codecov-action@v1 |
23 | | - with: |
24 | | - token: ${{ secrets.CODECOV_TOKEN }} |
25 | | - file: ./coverage.xml |
26 | | - fail_ci_if_error: false |
27 | 10 | python-matrix: |
28 | 11 | name: python-matrix |
29 | 12 | runs-on: ubuntu-latest |
30 | 13 | strategy: |
31 | 14 | matrix: |
32 | | - python-version: ["3.8", "3.9", "3.10"] |
| 15 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
33 | 16 | defaults: |
34 | 17 | run: |
35 | 18 | shell: bash -l {0} |
36 | 19 | steps: |
37 | | - - uses: actions/checkout@v2 |
| 20 | + - uses: actions/checkout@v3 |
38 | 21 | - name: Set up conda cache |
39 | | - uses: actions/cache@v2 |
| 22 | + uses: actions/cache@v4 |
40 | 23 | with: |
41 | 24 | path: ~/conda_pkgs_dir |
42 | 25 | key: ${{ runner.os }}-conda-${{ hashFiles('**/environment.yml') }} |
43 | 26 | restore-keys: ${{ runner.os }}-conda- |
44 | 27 | - name: Set up pip cache |
45 | | - uses: actions/cache@v2 |
| 28 | + uses: actions/cache@v4 |
46 | 29 | with: |
47 | 30 | path: ~/.cache/pip |
48 | 31 | key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg', '**/requirements-dev.txt') }} |
49 | 32 | restore-keys: ${{ runner.os }}-pip- |
50 | 33 | - name: Set up Conda with Python ${{ matrix.python-version }} |
51 | | - uses: conda-incubator/setup-miniconda@v2 |
| 34 | + uses: conda-incubator/setup-miniconda@v3 |
52 | 35 | with: |
53 | 36 | auto-update-conda: true |
54 | 37 | python-version: ${{ matrix.python-version }} |
55 | 38 | - name: Update Conda's environemnt |
56 | 39 | run: conda env update -f environment.yml -n test |
57 | 40 | - name: Execute linters and test suites |
58 | 41 | run: ./scripts/cibuild |
59 | | - docker: |
60 | | - name: docker |
61 | | - needs: |
62 | | - - codecov |
63 | | - - python-matrix |
64 | | - permissions: |
65 | | - contents: read |
66 | | - packages: write |
67 | | - runs-on: ubuntu-latest |
68 | | - steps: |
69 | | - - name: Set up Python 3.x |
70 | | - uses: actions/setup-python@v2 |
71 | | - with: |
72 | | - python-version: "3.x" |
73 | | - - name: Checkout |
74 | | - uses: actions/checkout@v2 |
75 | | - - name: Login to GitHub Container Registry |
76 | | - uses: docker/login-action@v1 |
77 | | - with: |
78 | | - registry: ${{ env.DOCKER_REGISTRY }} |
79 | | - username: ${{ github.actor }} |
80 | | - password: ${{ secrets.GITHUB_TOKEN }} |
81 | | - - name: Run rename script if in the template repo |
82 | | - run: | |
83 | | - if [[ "$GITHUB_REPOSITORY" == */template ]]; then |
84 | | - scripts/rename |
85 | | - fi |
86 | | - - name: Source build args |
87 | | - run: | |
88 | | - source ./docker_env |
89 | | - STACTOOLS_VERSION=$(python scripts/stactools-version.py) |
90 | | - echo "stactools_version=$STACTOOLS_VERSION" >> $GITHUB_ENV |
91 | | - echo "docker_workdir=$DOCKER_WORKDIR" >> $GITHUB_ENV |
92 | | - echo "docker_namespace_package_dir=$DOCKER_NAMESPACE_PACKAGE_DIR" >> $GITHUB_ENV |
93 | | - - name: Docker meta main |
94 | | - id: meta-main |
95 | | - uses: docker/metadata-action@v3 |
96 | | - with: |
97 | | - images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} |
98 | | - tags: | |
99 | | - type=ref,event=branch |
100 | | - type=ref,event=pr |
101 | | - - name: Build and push main |
102 | | - uses: docker/build-push-action@v2 |
103 | | - with: |
104 | | - context: . |
105 | | - file: docker/Dockerfile |
106 | | - build-args: | |
107 | | - STACTOOLS_VERSION=${{ env.stactools_version }} |
108 | | - DOCKER_WORKDIR=${{ env.docker_workdir }} |
109 | | - DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }} |
110 | | - # Don't try to push if the event is a PR from a fork |
111 | | - push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} |
112 | | - tags: ${{ steps.meta-main.outputs.tags }} |
113 | | - labels: ${{ steps.meta-main.outputs.labels }} |
114 | | - - name: Docker meta dev |
115 | | - id: meta-dev |
116 | | - uses: docker/metadata-action@v3 |
117 | | - with: |
118 | | - images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} |
119 | | - flavor: | |
120 | | - suffix=-dev |
121 | | - tags: | |
122 | | - type=ref,event=branch |
123 | | - type=ref,event=pr |
124 | | - - name: Build and push dev |
125 | | - uses: docker/build-push-action@v2 |
126 | | - with: |
127 | | - context: . |
128 | | - file: docker/Dockerfile-dev |
129 | | - build-args: | |
130 | | - STACTOOLS_VERSION=${{ env.stactools_version }} |
131 | | - DOCKER_WORKDIR=${{ env.docker_workdir }} |
132 | | - DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }} |
133 | | - # Don't try to push if the event is a PR from a fork |
134 | | - push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} |
135 | | - tags: ${{ steps.meta-dev.outputs.tags }} |
136 | | - labels: ${{ steps.meta-dev.outputs.labels }} |
0 commit comments