[typedclojure-release] 1.4.2 1.4.3-SNAPSHOT #2032
This file contains hidden or 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
name: Test and deploy | |
on: | |
#FIXME double builds on self pull requests | |
pull_request: | |
push: | |
schedule: | |
# Every Monday and Friday at 1PM UTC (9AM EST) | |
- cron: "0 13 * * 1,5" | |
env: | |
CLOJURE_CLI_VERSION: "1.12.0.1530" | |
BABASHKA_VERSION: "1.12.197" | |
jobs: | |
setup: | |
# delegate self-pull-requests to push jobs and run cron only in main repo | |
if: ${{ !((github.event.pull_request.head.repo.owner.login == 'typedclojure' || | |
github.event.pull_request.head.repo.owner.login == 'frenchy64') | |
&& github.event_name == 'pull_request') | |
&& | |
(github.repository == 'typedclojure/typedclojure' || | |
github.event_name != 'schedule') | |
}} | |
runs-on: ubuntu-24.04 | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeLaGuardo/setup-clojure@13.1 | |
with: | |
bb: ${{env.BABASHKA_VERSION}} | |
- run: bb --version | |
- run: ./script-test/test_runner.clj | |
- name: Print test matrix | |
id: set-matrix | |
run: ./script/print-actions-matrix.clj | |
test: | |
needs: setup | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: ${{ fromJson(needs.setup.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
id: test-deps-cache | |
with: | |
path: | | |
~/.m2/repository | |
~/.gitlibs | |
key: ${{ runner.os }}-test-deps-${{ matrix.submodule_hash }}-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/deps.edn') }}-${{ env.CLOJURE_CLI_VERSION }} | |
restore-keys: | | |
${{ runner.os }}-test-deps-${{ matrix.submodule_hash }}-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/deps.edn') }}- | |
${{ runner.os }}-test-deps-${{ matrix.submodule_hash }}-${{ hashFiles('**/pom.xml') }}- | |
${{ runner.os }}-test-deps-${{ matrix.submodule_hash }}- | |
${{ runner.os }}-test-deps- | |
- name: Set up JDK ${{ matrix.jdk }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.jdk }} | |
- uses: DeLaGuardo/setup-clojure@13.1 | |
with: | |
cli: ${{ env.CLOJURE_CLI_VERSION }} | |
- name: Run ${{ matrix.submodule }} tests | |
run: ./script/run-ci-submodule-tests.sh | |
env: | |
CLOJURE_VERSION: ${{ matrix.clojure }} | |
SUBMODULE: ${{ matrix.submodule }} | |
SKIP_DOWNLOAD: false #${{ steps.test-deps-cache.outputs.cache-hit }} | |
check-docs: | |
runs-on: ubuntu-24.04 | |
if: ${{ github.repository == 'typedclojure/typedclojure' | |
&& github.event_name == 'schedule' | |
}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeLaGuardo/setup-clojure@13.1 | |
with: | |
bb: ${{env.BABASHKA_VERSION}} | |
- run: bb --version | |
- run: ./script-test/test_runner.clj | |
- run: ./script/check_docs.clj | |
all-pr-checks: | |
needs: test | |
runs-on: ubuntu-24.04 | |
steps: | |
- run: echo "All tests pass!" | |
deploy: | |
needs: all-pr-checks | |
if: ${{ github.ref == 'refs/heads/main' | |
&& github.repository == 'typedclojure/typedclojure' | |
&& github.event_name == 'push' | |
}} | |
runs-on: ubuntu-24.04 | |
env: | |
DEPLOY_JDK: 11 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.m2/repository | |
~/.gitlibs | |
key: ${{ runner.os }}-deploy-deps-${{ matrix.submodule_hash }}-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/deps.edn') }}-${{ env.CLOJURE_CLI_VERSION }} | |
restore-keys: | | |
${{ runner.os }}-deploy-deps-${{ matrix.submodule_hash }}-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/deps.edn') }}- | |
${{ runner.os }}-deploy-deps-${{ matrix.submodule_hash }}-${{ hashFiles('**/pom.xml') }}- | |
${{ runner.os }}-deploy-deps-${{ matrix.submodule_hash }}- | |
${{ runner.os }}-deploy-deps- | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4.1.0 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-west-2 | |
- name: Set up JDK ${{ env.DEPLOY_JDK }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ env.DEPLOY_JDK }} | |
- uses: DeLaGuardo/setup-clojure@13.4 | |
with: | |
cli: ${{ env.CLOJURE_CLI_VERSION }} | |
bb: ${{env.BABASHKA_VERSION}} | |
- run: bb --version | |
- name: Configure settings.xml | |
run: | | |
mkdir -p ~/.m2 | |
echo "<settings><servers><server><id>clojars</id><username>typedclojure-clojars</username><password>${{ secrets.ClojarsPassword }}</password></server></servers></settings>" > ~/.m2/settings.xml | |
- name: Deploy | |
run: ./script/deploy-actions.sh | |
env: | |
AWS_BUCKET: ${{ secrets.AWS_BUCKET }} | |
- run: rm -f ~/.m2/settings.xml | |
if: ${{ always() }} |