format: import optimize #186
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
| # @Github: https://github.com/Certseeds/algorithm-template-java | |
| # @Organization: SUSTech | |
| # @Author: nanoseeds | |
| # @Date: 2020-07-28 22:43:03 | |
| # @LastEditors: nanoseeds | |
| #@LastEditTime: 2020-07-28 23:43:03 | |
| # This is a basic workflow to help you get started with Actions | |
| name: test for release | |
| # Controls when the action will run. Triggers the workflow on push or pull request | |
| # events but only for the master branch | |
| on: [ push,pull_request ] | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| test: | |
| name: run maven test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v5 | |
| # The Java version to make available on the path. Takes a whole or semver Java version, | |
| # or 1.x syntax (e.g. 1.8 => Java 8.x). | |
| # Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28 | |
| - name: Setup Java JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Use java and javac | |
| run: javac -version; java -version | |
| - name: ubuntu clean build test | |
| run: mvn clean compile test -T 1C | |
| # This workflow contains a single job called "build" | |
| build: | |
| name: run script and build zip | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-latest | |
| needs: test | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - name: checkout code | |
| uses: actions/checkout@v5 | |
| # ensure the path and files of project | |
| - name: ensure the path and files of project | |
| run: sudo apt install tree; tree | |
| - name: Setup Java JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| # The Java version to make available on the path. Takes a whole or semver Java version, | |
| #or 1.x syntax (e.g. 1.8 => Java 8.x). | |
| # Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28 | |
| java-version: 21 | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| # - name: run script | |
| # working-directory: ./script | |
| # run: javac ./file_producer.java; java file_producer | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: script_no_need | |
| path: | | |
| ./** | |
| !.git/** | |
| !**/.git/** | |
| if-no-files-found: error | |
| # 压缩只执行一次(由 upload-artifact 完成); 无需预先 zip | |
| # Runs a set of commands using the runners shell | |
| - name: tree | |
| run: tree | |