diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index ba9fa43..79e9c53 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -1,46 +1,51 @@ -name: Java CI +name: CI -on: - push: - branches: [master, develop] - pull_request: - branches: [master, develop] - - workflow_dispatch: +on: [push] jobs: build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Set up JDK 17 uses: actions/setup-java@v4 with: - distribution: 'corretto' java-version: '17' - -# Github Authentication is required to download artifacts from github packages -# A secret is created for this repo, so that github actions can fetch it, the secret is named after GH_PAT_FOR_ACTIONS_TOKEN + distribution: 'adopt' + # Github Authentication is required to download artifacts from github packages + # A secret is created for this repo, so that github actions can fetch it, the secret is named after GH_PAT_FOR_ACTIONS_TOKEN - name: maven-settings uses: s4u/maven-settings-action@v2 with: servers: '[{"id": "github", "username": "madieUser", "password": "${GITHUB_TOKEN_REF}"}]' githubServer: false - - name: Build with Maven run: mvn clean install --file pom.xml env: GITHUB_TOKEN_REF: ${{ secrets.GH_PAT_FOR_ACTIONS_TOKEN }} - - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - - name: Cache local Maven repository - uses: actions/cache@v4 + publish-snapshot: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + if: github.ref == 'refs/heads/develop' + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + distribution: 'adopt' + java-version: '17' + + - name: Extract project version + run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) + id: project + + # publish snapshot iff the project version in pom.xml contains '-SNAPSHOT' + - name: Publish SNAPSHOT version to GitHub Packages + if: contains(steps.project.outputs.version, '-SNAPSHOT') + run: mvn -B --no-transfer-progress deploy -DskipTests + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pom.xml b/pom.xml index 81ce4c1..8e28194 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 6.1.11 3.4.0 madie-checkstyle.xml - 0.6.49-SNAPSHOT + 0.6.56-SNAPSHOT 2.9.0 diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000..fb4bdc6 --- /dev/null +++ b/settings.xml @@ -0,0 +1,36 @@ + + + + github + + + + + github + + + central + https://repo1.maven.org/maven2 + + + github + https://maven.pkg.github.com/MeasureAuthoringTool/madie-rest-commons/ + + true + + + + + + + + + github + ${env.GITHUB_USER} + ${env.GITHUB_TOKEN} + + + diff --git a/src/main/java/gov/cms/madie/cql_elm_translator/utils/cql/CQLTools.java b/src/main/java/gov/cms/madie/cql_elm_translator/utils/cql/CQLTools.java index f0a18a1..096f65d 100644 --- a/src/main/java/gov/cms/madie/cql_elm_translator/utils/cql/CQLTools.java +++ b/src/main/java/gov/cms/madie/cql_elm_translator/utils/cql/CQLTools.java @@ -130,7 +130,9 @@ public void generate() throws IOException { TranslationResource translationResource = TranslationResource.getInstance( - usingProperties.getLibraryType() == "FHIR"); // <-- BADDDDD!!!! Defaults to fhir + usingProperties.getLibraryType() == "FHIR" + || usingProperties.getLibraryType() + == "QICore"); // <-- BADDDDD!!!! Defaults to fhir CqlPreprocessorVisitor preprocessor = new CqlPreprocessorVisitor(